小编Gle*_*len的帖子

制作SSLEngine在Android(4.4.2)上使用TLSv1.2?

伙计们,我希望有一些显而易见的东西让我失踪,我希望有人能够解决一些问题.我试图让TLSv1.2在SSL + NIO上下文中运行(使用AndroidAsync库),所以我试图通过SSLEngine启用它.我可以运行这样的代码:

        SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
        sslContext.init(null, null, null);
        String[] protocols = sslContext.getSupportedSSLParameters().getProtocols();
        for (String protocol : protocols) {
            Timber.d("Context supported protocol: " + protocol);
        }

        SSLEngine engine = sslContext.createSSLEngine();
        String[] supportedProtocols = engine.getSupportedProtocols();
        for (String protocol : supportedProtocols) {
            Timber.d("Engine supported protocol: " + protocol);
        }
Run Code Online (Sandbox Code Playgroud)

我最终在logcat上看到了这个:

06-22 21:56:27.715    1117-1117/? D/XXX? Context supported protocol: SSLv3
06-22 21:56:27.715    1117-1117/? D/XXX? Context supported protocol: TLSv1
06-22 21:56:27.725    1117-1117/? D/XXX? Context supported protocol: TLSv1.1
06-22 21:56:27.725    1117-1117/? D/XXX? Context …
Run Code Online (Sandbox Code Playgroud)

android sslengine

22
推荐指数
2
解决办法
2万
查看次数

标签 统计

android ×1

sslengine ×1