com.gargoylesoftware.htmlunit.ssl
Class InsecureSSLProtocolSocketFactory

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.ssl.InsecureSSLProtocolSocketFactory
All Implemented Interfaces:
org.apache.http.conn.scheme.SocketFactory

public class InsecureSSLProtocolSocketFactory
extends Object
implements org.apache.http.conn.scheme.SocketFactory

A completely insecure (yet very easy to use) SSL socket factory. This socket factory will establish connections to any server from any client, regardless of credentials or the lack thereof. This is especially useful when you are trying to connect to a server with expired or corrupt certificates... this class doesn't care!

Version:
$Revision: 5724 $
Author:
Daniel Gredler, Nicolas Belisle
See Also:
WebClient.setUseInsecureSSL(boolean)

Constructor Summary
InsecureSSLProtocolSocketFactory()
          Creates a new insecure SSL protocol socket factory.
 
Method Summary
 Socket connectSocket(Socket sock, String host, int port, InetAddress localAddress, int localPort, org.apache.http.params.HttpParams params)
          
 Socket createSocket()
          
 Socket createSocket(Socket socket, String host, int port, boolean autoClose)
          
 boolean isSecure(Socket sock)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsecureSSLProtocolSocketFactory

public InsecureSSLProtocolSocketFactory()
                                 throws GeneralSecurityException
Creates a new insecure SSL protocol socket factory.

Throws:
GeneralSecurityException - if a security error occurs
Method Detail

createSocket

public Socket createSocket(Socket socket,
                           String host,
                           int port,
                           boolean autoClose)
                    throws IOException,
                           UnknownHostException

Throws:
IOException
UnknownHostException

connectSocket

public Socket connectSocket(Socket sock,
                            String host,
                            int port,
                            InetAddress localAddress,
                            int localPort,
                            org.apache.http.params.HttpParams params)
                     throws IOException,
                            UnknownHostException,
                            org.apache.http.conn.ConnectTimeoutException

Specified by:
connectSocket in interface org.apache.http.conn.scheme.SocketFactory
Throws:
IOException
UnknownHostException
org.apache.http.conn.ConnectTimeoutException

createSocket

public Socket createSocket()
                    throws IOException

Specified by:
createSocket in interface org.apache.http.conn.scheme.SocketFactory
Throws:
IOException

isSecure

public boolean isSecure(Socket sock)
                 throws IllegalArgumentException

Specified by:
isSecure in interface org.apache.http.conn.scheme.SocketFactory
Throws:
IllegalArgumentException


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.