Created
October 5, 2015 06:57
-
-
Save SeongUgJung/e9feed6ff82de6122bba to your computer and use it in GitHub Desktop.
All_Trust_SSLContext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private SSLContext getSSLContext() throws KeyManagementException, NoSuchAlgorithmException { | |
SSLContext context = SSLContext.getInstance("SSL"); | |
context.init(null, new TrustManager[]{new X509TrustManager() { | |
public void checkClientTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException { | |
} | |
public void checkServerTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException { | |
} | |
public X509Certificate[] getAcceptedIssuers() { | |
return new X509Certificate[0]; | |
} | |
} | |
}, new SecureRandom()); | |
return context; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment