Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nisshiee/7427533 to your computer and use it in GitHub Desktop.
Save nisshiee/7427533 to your computer and use it in GitHub Desktop.
SSLSocketFactory sslsf = new SSLSocketFactory(new TrustStrategy() {
@Override
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return true;
}
}, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
HttpClient cli = new DefaultHttpClient();
cli.getConnectionManager().getSchemeRegistry().register(new Scheme("https", 443, sslsf));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment