Hi Julius,
I think this Protocol.registerProtocol("https", stricthttps); will not work
with httpClient 3.1 if i m not mistaken.. because open() method of
HTTPConnection has this code...
if (isSecure() && isProxied()) {
Protocol defaultprotocol = Protocol.getProtocol("http");
socketFactory = defaultprotocol.getSocketFactory();
} else {
socketFactory = this.protocolInUse.getSocketFactory();
}
Thers no code that gets the socketfactory from ID "https"...
Anyways i found another solution for the problem .. i dont know if its
proper... I removed the extends StrictSSL
public class AsiteSocketFactory implements ProtocolSocketFactory {
public AsiteSocketFactory(boolean isHttps) throws
java.security.GeneralSecurityException, java.io.IOException{
if(isHttps){
}else{
}
public Socket createSocket(String host, int port) throws IOException,
UnknownHostException {
return new Socket(host,port);
}
public Socket createSocket(String host, int port, InetAddress
localAddress, int localPort) throws IOException, UnknownHostException {
return new Socket(host,port,localAddress,localPort);
}
public Socket createSocket(String host, int port, InetAddress
localAddress, int localPort, HttpConnectionParams params)
throws IOException, UnknownHostException, ConnectException {
Socket rval;
if (params == null) {
throw new IllegalArgumentException("Parameters may not be
null");
}
rval = new Socket(Proxy.NO_PROXY);
SocketAddress localaddr = new
InetSocketAddress(localAddress, localPort);
SocketAddress remoteaddr = new InetSocketAddress(host, port);
rval.bind(localaddr);
rval.connect(remoteaddr);
return rval;
}
}
On 10/29/07, Julius Davies <[EMAIL PROTECTED]> wrote:
>
> I would recommend replacing this:
> Protocol.registerProtocol("http", stricthttps);
>
>
> With this:
> Protocol.registerProtocol("https", stricthttps);
>
>
> --
> yours,
>
> Julius Davies
> 250-592-2284 (Home)
> 250-893-4579 (Mobile)
> http://juliusdavies.ca/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>