VideoView 如何启用 TLS 1.2?
VideoView how to enable TLS 1.2?
我正在使用 VideoView 在我的应用程序中下载和播放视频。服务器通过 tls 1.2 协议进行通信,默认情况下在 Android 4.4.2(KitKat) 设备上禁用。因为我没有使用任何特殊的 http 客户端来下载流,而是 android 的 VideoView 组件,所以我找不到设置 VideoView 的 ssl 套接字工厂的方法。无论如何要为 VideoView http 连接启用 Tls 1.2?
请检查下面link:
Making SSLEngine use TLSv1.2 on Android (4.4.2)?.
我在图像方面遇到过这个问题,希望这个解决方案也能帮助您查看视频。
try {
ProviderInstaller.installIfNeeded(getApplicationContext());
SSLContext sslContext = null;
sslContext = SSLContext.getInstance("TLSv1.2");
try {
sslContext.init(null, null, null);
SSLEngine engine = sslContext.createSSLEngine();
engine.getEnabledCipherSuites();
} catch (KeyManagementException e) {
e.printStackTrace();
}
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (GooglePlayServicesNotAvailableException e) {
e.printStackTrace();
} catch (GooglePlayServicesRepairableException e) {
e.printStackTrace();
}
我正在使用 VideoView 在我的应用程序中下载和播放视频。服务器通过 tls 1.2 协议进行通信,默认情况下在 Android 4.4.2(KitKat) 设备上禁用。因为我没有使用任何特殊的 http 客户端来下载流,而是 android 的 VideoView 组件,所以我找不到设置 VideoView 的 ssl 套接字工厂的方法。无论如何要为 VideoView http 连接启用 Tls 1.2?
请检查下面link:
Making SSLEngine use TLSv1.2 on Android (4.4.2)?.
我在图像方面遇到过这个问题,希望这个解决方案也能帮助您查看视频。
try {
ProviderInstaller.installIfNeeded(getApplicationContext());
SSLContext sslContext = null;
sslContext = SSLContext.getInstance("TLSv1.2");
try {
sslContext.init(null, null, null);
SSLEngine engine = sslContext.createSSLEngine();
engine.getEnabledCipherSuites();
} catch (KeyManagementException e) {
e.printStackTrace();
}
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (GooglePlayServicesNotAvailableException e) {
e.printStackTrace();
} catch (GooglePlayServicesRepairableException e) {
e.printStackTrace();
}