add support for specifying SSLSocketFactory #2

Merged
merged 1 commit into from May 31, 2011
@@ -6,6 +6,7 @@ import org.apache.commons.codec.binary.Base64
import javax.net.ssl.HttpsURLConnection
import javax.net.ssl.SSLContext
import javax.net.ssl.SSLSession
+import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
import javax.net.ssl.HostnameVerifier
@@ -36,6 +37,11 @@ object HttpOptions {
httpsConn.setSSLSocketFactory(sc.getSocketFactory())
case _ => // do nothing
}
+ def sslSocketFactory(sslSocketFactory: SSLSocketFactory): HttpOption = c => c match {
+ case httpsConn: HttpsURLConnection =>
+ httpsConn.setSSLSocketFactory(sslSocketFactory)
+ case _ => // do nothing
+ }
}
object MultiPart {