Last active
August 29, 2015 13:56
-
-
Save seamusv/9341046 to your computer and use it in GitHub Desktop.
Ignore SSL Certificates
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
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