Created
November 28, 2011 03:38
-
-
Save moxie0/1398995 to your computer and use it in GitHub Desktop.
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
TrustManager[] trustManagers = new TrustManager[1]; | |
trustManagers[0] = new PinningTrustManager(new String[] {"f30012bbc18c231ac1a44b788e410ce754182513"}); | |
SSLContext sslContext = SSLContext.getInstance("TLS"); | |
sslContext.init(null, trustManagers, null); | |
HttpsURLConnection urlConnection = (HttpsURLConnection)new URL("https://encrypted.google.com/").openConnection(); | |
urlConnection.setSSLSocketFactory(sslContext.getSocketFactory()); | |
InputStream in = urlConnection.getInputStream(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment