org.edg.security.httpclient
Class CipherSSLSocketFactory

java.lang.Object
  |
  +--javax.net.SocketFactory
        |
        +--javax.net.ssl.SSLSocketFactory
              |
              +--org.edg.security.httpclient.CipherSSLSocketFactory

public class CipherSSLSocketFactory
extends javax.net.ssl.SSLSocketFactory

A SSL socket factory that returns a SSLSocket having the given ciphersuite enabled.

Author:
wolfgang.hoschek@cern.ch

Constructor Summary
CipherSSLSocketFactory()
          MySSLSocketFactory constructor comment.
CipherSSLSocketFactory(javax.net.ssl.SSLSocketFactory child, java.lang.String[] cipherSuites)
          MySSLSocketFactory constructor comment.
 
Method Summary
 java.net.Socket createSocket(java.net.InetAddress address, int port)
          Returns a socket connected to a ServerSocket at the specified network address and port.
 java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress clientAddress, int clientPort)
          Returns a socket connected to a ServerSocket at the specified network address and port.
 java.net.Socket createSocket(java.net.Socket socket, java.lang.String host, int port, boolean autoClose)
          Returns a socket layered over an existing socket connected to the named host, at the given port.
 java.net.Socket createSocket(java.lang.String host, int port)
          Returns a socket connected to a ServerSocket on the named host, at the given port.
 java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress clientAddress, int clientPort)
          Returns a socket connected to a ServerSocket on the named host, at the given port.
 java.lang.String[] getDefaultCipherSuites()
          Returns the list of cipher suites which are enabled by default.
 java.lang.String[] getSupportedCipherSuites()
          Returns the names of the cipher suites which could be enabled for use on an SSL connection.
protected  java.net.Socket initializeSocket(java.net.Socket socket)
          createSocket method comment.
 void setEnabledCipherSuites(java.lang.String[] suites)
          Controls which particular cipher suites are enabled for use on sockets generated by this factory.
 
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

CipherSSLSocketFactory

public CipherSSLSocketFactory()
MySSLSocketFactory constructor comment.


CipherSSLSocketFactory

public CipherSSLSocketFactory(javax.net.ssl.SSLSocketFactory child,
                              java.lang.String[] cipherSuites)
MySSLSocketFactory constructor comment.

Method Detail

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Returns a socket connected to a ServerSocket on the named host, at the given port.

Specified by:
createSocket in class javax.net.SocketFactory
java.io.IOException
java.net.UnknownHostException

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress clientAddress,
                                    int clientPort)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Returns a socket connected to a ServerSocket on the named host, at the given port.

Specified by:
createSocket in class javax.net.SocketFactory
java.io.IOException
java.net.UnknownHostException

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port)
                             throws java.io.IOException
Returns a socket connected to a ServerSocket at the specified network address and port.

Specified by:
createSocket in class javax.net.SocketFactory
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port,
                                    java.net.InetAddress clientAddress,
                                    int clientPort)
                             throws java.io.IOException
Returns a socket connected to a ServerSocket at the specified network address and port.

Specified by:
createSocket in class javax.net.SocketFactory
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.Socket socket,
                                    java.lang.String host,
                                    int port,
                                    boolean autoClose)
                             throws java.io.IOException
Returns a socket layered over an existing socket connected to the named host, at the given port.

Specified by:
createSocket in class javax.net.ssl.SSLSocketFactory
java.io.IOException

getDefaultCipherSuites

public java.lang.String[] getDefaultCipherSuites()
Returns the list of cipher suites which are enabled by default.

Specified by:
getDefaultCipherSuites in class javax.net.ssl.SSLSocketFactory

getSupportedCipherSuites

public java.lang.String[] getSupportedCipherSuites()
Returns the names of the cipher suites which could be enabled for use on an SSL connection.

Specified by:
getSupportedCipherSuites in class javax.net.ssl.SSLSocketFactory

initializeSocket

protected java.net.Socket initializeSocket(java.net.Socket socket)
createSocket method comment.


setEnabledCipherSuites

public void setEnabledCipherSuites(java.lang.String[] suites)
                            throws java.lang.IllegalArgumentException
Controls which particular cipher suites are enabled for use on sockets generated by this factory. The cipher suites must have been listed by getSupportedCipherSuites() as being supported. Even if a suite has been enabled, it might never be used if no peer supports it, or the requisite certificates (and private keys) are not available.

Parameters:
suites - Names of all the cipher suites to enable
Throws:
java.lang.IllegalArgumentException - - when one or more of the ciphers named by the parameter is not supported, or when the parameter is null.