Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created October 24, 2011 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiredman/1309519 to your computer and use it in GitHub Desktop.
Save hiredman/1309519 to your computer and use it in GitHub Desktop.
fix-ssl
(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