Created
November 5, 2015 08:59
-
-
Save brianhsu/8cca792e8357ea6419d5 to your computer and use it in GitHub Desktop.
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
SSLContext context = SSLContext.getInstance("TLS"); | |
context.init(null, new X509TrustManager[]{new X509TrustManager(){ | |
public void checkClientTrusted(X509Certificate[] chain, | |
String authType) throws CertificateException {} | |
public void checkServerTrusted(X509Certificate[] chain, | |
String authType) throws CertificateException {} | |
public X509Certificate[] getAcceptedIssuers() { | |
return new X509Certificate[0]; | |
}}}, new SecureRandom()); | |
http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/smack/ConnectionConfiguration.Builder.html#setCustomSSLContext%28javax.net.ssl.SSLContext%29 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment