Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from tjulien/master
Browse files Browse the repository at this point in the history
add support for specifying SSLSocketFactory
  • Loading branch information
hoffrocket committed May 31, 2011
2 parents a21b8f7 + e8f6be3 commit debe464
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/scala/scalaj/http/Http.scala
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit debe464

Please sign in to comment.