This commit is contained in:
Subrahmanyam Mandavilli 2016-02-11 10:51:28 +05:30
Родитель fe15244e34
Коммит 8e7529cf13
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -15,14 +15,11 @@ public class SkipCACheck {
TrustManager[] trustAllCerts = new TrustManager[1]; TrustManager[] trustAllCerts = new TrustManager[1];
TrustManager trustManager = new TrustAllTrustManager(); TrustManager trustManager = new TrustAllTrustManager();
trustAllCerts[0] = trustManager; trustAllCerts[0] = trustManager;
SSLContext sslContext = SSLContext.getInstance("SSL"); SSLContext sslContext = SSLContext.getInstance("SSL");
SSLSessionContext serverSessionContext = sslContext.getServerSessionContext(); SSLSessionContext serverSessionContext = sslContext.getServerSessionContext();
serverSessionContext.setSessionTimeout(30 * 60); serverSessionContext.setSessionTimeout(30 * 60);
sslContext.init(null, trustAllCerts, null); sslContext.init(null, trustAllCerts, null);
setDefaultSSLSocketFactory(sslContext.getSocketFactory()); setDefaultSSLSocketFactory(sslContext.getSocketFactory());
setDefaultHostnameVerifier(verifier); setDefaultHostnameVerifier(verifier);
} }