Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add support for specifying SSLSocketFactory #2

Merged
merged 1 commit into from

2 participants

Tim Julien Jon Hoffman
Tim Julien

No description provided.

Jon Hoffman hoffrocket merged commit debe464 into from
Tim Julien

thx - can you publish a release?

Jon Hoffman
Owner
Jon Hoffman
Owner
Tim Julien

looks like FoursquareProject.scala is already on 0.2.5. confused. maybe a forked version? do we need 0.2.6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 31, 2011
  1. Tim Julien
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/main/scala/scalaj/http/Http.scala
6 src/main/scala/scalaj/http/Http.scala
View
@@ -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 {
Something went wrong with that request. Please try again.