commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r390048 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
Date Thu, 30 Mar 2006 09:51:03 GMT
Author: olegk
Date: Thu Mar 30 01:51:02 2006
New Revision: 390048

URL: http://svn.apache.org/viewcvs?rev=390048&view=rev
Log:
PR #39047 (Disallow the use of SecureProtocolSocketFactory with ProxyClient)

Contributed by Oleg Kalnichevski
Reviewed by Roland Weber and Ortwin Gl├╝ck

Modified:
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java?rev=390048&r1=390047&r2=390048&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
Thu Mar 30 01:51:02 2006
@@ -36,7 +36,6 @@
 import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
 import org.apache.commons.httpclient.params.HttpParams;
 
-
 /**
  * A client that provides {@link java.net.Socket sockets} for communicating through HTTP
proxies
  * via the HTTP CONNECT method.  This is primarily needed for non-HTTP protocols that wish
to 
@@ -179,12 +178,16 @@
      */
     public ConnectResponse connect() throws IOException, HttpException {
         
-        if (getHostConfiguration().getProxyHost() == null) {
+        HostConfiguration hostconf = getHostConfiguration();
+        if (hostconf.getProxyHost() == null) {
             throw new IllegalStateException("proxy host must be configured");
         }
-        if (getHostConfiguration().getHost() == null) {
+        if (hostconf.getHost() == null) {
             throw new IllegalStateException("destination host must be configured");
         }
+        if (hostconf.getProtocol().isSecure()) {
+            throw new IllegalStateException("secure protocol socket factory may not be used");
+        }
         
         ConnectMethod method = new ConnectMethod();
         method.getParams().setDefaults(getParams());
@@ -194,7 +197,7 @@
         
         HttpMethodDirector director = new HttpMethodDirector(
             connectionManager,
-            getHostConfiguration(),
+            hostconf,
             getParams(),
             getState()
         );



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


Mime
View raw message