commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpMultiClient.java
Date Sun, 28 Jul 2002 06:23:06 GMT
dion        2002/07/27 23:23:06

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpMultiClient.java
  Log:
  ssl patch provided by Simon Roberts
  
  Revision  Changes    Path
  1.12      +20 -4     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMultiClient.java
  
  Index: HttpMultiClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMultiClient.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- HttpMultiClient.java	23 Jul 2002 14:38:31 -0000	1.11
  +++ HttpMultiClient.java	28 Jul 2002 06:23:06 -0000	1.12
  @@ -67,6 +67,8 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  +import javax.net.ssl.SSLSocketFactory;
  +
   /**
    *
    * An Http user-agent that supports multiple connections
  @@ -97,6 +99,8 @@
       /** how long to wait for a request to complete */
       private int timeoutRequest = 0;
   
  +    private SSLSocketFactory sslSocketFactory = null;
  +
       // ----------------------------------------------------------- Constructors
   
       /**
  @@ -251,6 +255,15 @@
       }
   
       /**
  +     * Specifies an alternative factory for SSL sockets.
  +     * @see HttpConnection#setSSLSocketFactory(SSLSocketFactory) HttpConnection.setSSLSocketFactory
  +     * @param sslSocketFactory a living instance of the alternative SSLSocketFactory
  +     */
  +    public void setSSLSocketFactory(SSLSocketFactory sslSocketFactory) {
  +        this.sslSocketFactory = sslSocketFactory;
  +    }
  +
  +    /**
        * Returns the HTTP proxy server port number
        * 
        * @return the HTTP proxy server port number
  @@ -282,7 +295,10 @@
           HttpConnection connection = mgr.getConnection(method.getUrl(), 
               timeoutConnection);
           connection.setSoTimeout(timeoutRequest);
  -        
  +        if (!connection.isOpen()) {
  +            connection.setSSLSocketFactory(sslSocketFactory);
  +        }
  +
           int status = 0;
   
           method.setStrictMode(strictMode);
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message