Index: src/com/caucho/hessian/client/HessianProxyFactory.java
===================================================================
--- src/com/caucho/hessian/client/HessianProxyFactory.java	(revision 5400)
+++ src/com/caucho/hessian/client/HessianProxyFactory.java	(working copy)
@@ -57,6 +57,9 @@
 import javax.naming.RefAddr;
 import javax.naming.Reference;
 import javax.naming.spi.ObjectFactory;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLSocketFactory;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -116,6 +119,7 @@
     = Logger.getLogger(HessianProxyFactory.class.getName());
 
   private SerializerFactory _serializerFactory;
+  private SSLSocketFactory _sslSocketFactory;
   private HessianRemoteResolver _resolver;
 
   private ClassLoader _loader;
@@ -291,6 +295,14 @@
   }
 
   /**
+   * Sets the SSLSocketFactory to use for HTTPS.
+   */
+  public void setSSLSocketFactory(SSLSocketFactory sslSocketFactory)
+  {
+      _sslSocketFactory = sslSocketFactory;
+  }
+
+  /**
    * Creates the URL connection.
    */
   protected URLConnection openConnection(URL url)
@@ -322,6 +334,10 @@
       conn.setRequestProperty("Authorization", _basicAuth);
     }
 
+    if (_sslSocketFactory != null && conn instanceof HttpsURLConnection) {
+        ((HttpsURLConnection)conn).setSSLSocketFactory(_sslSocketFactory);
+    }
+
     return conn;
   }
 
