Skip to content

Instantly share code, notes, and snippets.

@seamusv
Last active August 29, 2015 13:56
Show Gist options
  • Save seamusv/9341046 to your computer and use it in GitHub Desktop.
Save seamusv/9341046 to your computer and use it in GitHub Desktop.
Ignore SSL Certificates
implicit val trustfulSslContext: SSLContext = {
object WideOpenX509TrustManager extends X509TrustManager {
override def checkClientTrusted(chain: Array[X509Certificate], authType: String) = ()
override def checkServerTrusted(chain: Array[X509Certificate], authType: String) = ()
override def getAcceptedIssuers = Array[X509Certificate]()
}
val context = SSLContext.getInstance("TLS")
context.init(Array[KeyManager](), Array(WideOpenX509TrustManager), null)
context
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment