brooklyn.test
Class TrustingSslSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by brooklyn.test.TrustingSslSocketFactory

public class TrustingSslSocketFactory
extends SSLSocketFactory


Field Summary
static TrustManager TRUST_ALL
          trusts all SSL certificates
 
Constructor Summary
protected TrustingSslSocketFactory()
           
 
Method Summary
static
<T extends URLConnection>
T
configure(T connection)
          configures a connection to accept all certificates, if it is for https
 Socket createSocket()
           
 Socket createSocket(InetAddress arg0, int arg1)
           
 Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2, int arg3)
           
 Socket createSocket(Socket socket, String host, int port, boolean autoClose)
           
 Socket createSocket(String arg0, int arg1)
           
 Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3)
           
 String[] getDefaultCipherSuites()
           
static TrustingSslSocketFactory getInstance()
           
 String[] getSupportedCipherSuites()
           
 
Methods inherited from class javax.net.ssl.SSLSocketFactory
getDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRUST_ALL

public static final TrustManager TRUST_ALL
trusts all SSL certificates

Constructor Detail

TrustingSslSocketFactory

protected TrustingSslSocketFactory()
Method Detail

getInstance

public static TrustingSslSocketFactory getInstance()

configure

public static <T extends URLConnection> T configure(T connection)
configures a connection to accept all certificates, if it is for https


createSocket

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

createSocket

public Socket createSocket()
                    throws IOException
Overrides:
createSocket in class SocketFactory
Throws:
IOException

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 arg0,
                           int arg1)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

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

createSocket

public Socket createSocket(String arg0,
                           int arg1,
                           InetAddress arg2,
                           int arg3)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(InetAddress arg0,
                           int arg1,
                           InetAddress arg2,
                           int arg3)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException


Copyright © 2013. All Rights Reserved.