org.pircbotx
Class TrustingSSLSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by org.pircbotx.TrustingSSLSocketFactory

public class TrustingSSLSocketFactory
extends SSLSocketFactory

An SSLSocketFactory implementation that treats all certificates as valid. Use with care.

Author:
Originally by: Kjell Arne Brudvik from brudvik.org

Implemented and Maintained in PircBotX by: Leon Blakey


Constructor Summary
TrustingSSLSocketFactory()
          Create a new SSLSocketFactory factory that will create Sockets regardless of what certificate is used.
 
Method Summary
 Socket createSocket(InetAddress address, int port)
           
 Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
           
 Socket createSocket(Socket s, String host, int port, boolean autoClose)
           
 Socket createSocket(String host, int port)
           
 Socket createSocket(String host, int port, InetAddress localHost, int localPort)
           
 String[] getDefaultCipherSuites()
           
 String[] getSupportedCipherSuites()
           
 
Methods inherited from class javax.net.ssl.SSLSocketFactory
getDefault
 
Methods inherited from class javax.net.SocketFactory
createSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrustingSSLSocketFactory

public TrustingSSLSocketFactory()
                         throws SSLException
Create a new SSLSocketFactory factory that will create Sockets regardless of what certificate is used.

Throws:
SSLException - if it cannot initialize correctly.
Method Detail

getDefaultCipherSuites

public String[] getDefaultCipherSuites()
Specified by:
getDefaultCipherSuites in class SSLSocketFactory

getSupportedCipherSuites

public String[] getSupportedCipherSuites()
Specified by:
getSupportedCipherSuites in class SSLSocketFactory

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(String host,
                           int port,
                           InetAddress localHost,
                           int localPort)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(InetAddress address,
                           int port)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(InetAddress address,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(Socket s,
                           String host,
                           int port,
                           boolean autoClose)
                    throws IOException
Specified by:
createSocket in class SSLSocketFactory
Throws:
IOException


Copyright © 2010-2011 Leon Blakey. All Rights Reserved.