Index: /home/oleg/src/apache.org/jakarta/commons-httpclient/src/java/org/apache/commons/httpclient/ProxyClient.java =================================================================== --- /home/oleg/src/apache.org/jakarta/commons-httpclient/src/java/org/apache/commons/httpclient/ProxyClient.java (revision 381313) +++ /home/oleg/src/apache.org/jakarta/commons-httpclient/src/java/org/apache/commons/httpclient/ProxyClient.java (working copy) @@ -35,6 +35,7 @@ import org.apache.commons.httpclient.params.HttpClientParams; import org.apache.commons.httpclient.params.HttpConnectionManagerParams; import org.apache.commons.httpclient.params.HttpParams; +import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; /** @@ -179,12 +180,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().getSocketFactory() instanceof SecureProtocolSocketFactory) { + throw new IllegalStateException("secure protocol socket factory may not be used"); + } ConnectMethod method = new ConnectMethod(); method.getParams().setDefaults(getParams()); @@ -194,7 +199,7 @@ HttpMethodDirector director = new HttpMethodDirector( connectionManager, - getHostConfiguration(), + hostconf, getParams(), getState() );