Disable SSL as a protocol in HttpsURLConnection

后端 未结 6 1755
眼角桃花
眼角桃花 2020-12-02 15:14

Due to the POODLE vulnerability, my server, hosted in Amazon AWS does no longer support SSLv3.

As a result, the first HTTPS connection my Android app does against th

6条回答
  •  难免孤独
    2020-12-02 15:48

    Also you should know that you can force TLS v1.2 for Android 4.0 devices that don't have it enabled by default:

    This should be in the first line of your Application:

     try {
                ProviderInstaller.installIfNeeded(getApplicationContext());
                SSLContext sslContext;
                sslContext = SSLContext.getInstance("TLSv1.2");
                sslContext.init(null, null, null);
                sslContext.createSSLEngine();
            } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException
                    | NoSuchAlgorithmException | KeyManagementException e) {
                e.printStackTrace();
            }
    

提交回复
热议问题