Created
November 5, 2012 11:01
-
-
Save pwntester/4016643 to your computer and use it in GitHub Desktop.
TrustManager
This file contains 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
public CustomSSLSocketFactory(KeyStore truststore) | |
throws NoSuchAlgorithmException, KeyManagementException, | |
KeyStoreException, UnrecoverableKeyException { | |
super(truststore); | |
TrustManager tm = new X509TrustManager() { | |
public java.security.cert.X509Certificate[] getAcceptedIssuers() { | |
return null; | |
} | |
@Override | |
public void checkClientTrusted( | |
java.security.cert.X509Certificate[] chain, String authType) | |
throws java.security.cert.CertificateException { | |
// TODO Auto-generated method stub | |
} | |
@Override | |
public void checkServerTrusted( | |
java.security.cert.X509Certificate[] chain, String authType) | |
throws java.security.cert.CertificateException { | |
// TODO Auto-generated method stub | |
} | |
}; | |
sslContext.init(null, new TrustManager[] { tm }, null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment