Created
October 24, 2011 17:01
-
-
Save hiredman/1309519 to your computer and use it in GitHub Desktop.
fix-ssl
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
(defonce fix-ssl | |
(delay | |
(let [mangers (into-array TrustManager | |
[(reify X509TrustManager | |
(getAcceptedIssuers [_] nil) | |
(checkClientTrusted [_ certs type]) | |
(checkServerTrusted [_ certs type]))]) | |
ssl-cxt (doto (SSLContext/getInstance "SSL") | |
(.init nil mangers (java.security.SecureRandom.)))] | |
(HttpsURLConnection/setDefaultSSLSocketFactory | |
(.getSocketFactory ssl-cxt))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment