Class SSLSocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- javax.net.ssl.SSLSocketFactory
-
- com.ibm.websphere.ssl.protocol.SSLSocketFactory
-
public class SSLSocketFactory extends javax.net.ssl.SSLSocketFactoryThis class is for creating SSLSockets. It utilizes the com.ibm.websphere.ssl.JSSEHelper APIs to retrieve WebSphere SSL configuration information. You can pass in a Properties object containing SSL properties, or an SSL alias, or allow it to return the default SSLSocketFactory.
- Since:
- WAS 6.1
- Version:
- 1.0
- See Also:
JSSEHelper
-
-
Field Summary
Fields Modifier and Type Field and Description protected booleandefault_constructorprotected java.util.MapldapConnectionInfoprotected java.util.Propertiespropsprotected static java.util.MapvalidateLdapConnectionInfo
-
Constructor Summary
Constructors Constructor and Description SSLSocketFactory()This is the default constructor which will retrieve the default SSL configuration for creating Sockets.SSLSocketFactory(java.util.Properties sslprops)This constructor allows you to pass in a set of SSL properties used for creating Sockets.SSLSocketFactory(java.lang.String alias)This constructor allows you to pass in an SSL alias to retrieve an SSL configuration other than the default for creating Sockets.SSLSocketFactory(java.lang.String alias, java.util.Map connectionInfo)This constructor allows you to pass in an SSL alias, and/or connectionInfo.
-
Method Summary
Methods Modifier and Type Method and Description intcompare(javax.net.SocketFactory sf1, javax.net.SocketFactory sf2)java.net.SocketcreateSocket()Creates an unconnected socket.java.net.SocketcreateSocket(java.net.InetAddress host, int port)Creates a socket and connects it to the specified port number at the specified address.java.net.SocketcreateSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort)Creates a socket and connects it to the specified remote host on the specified remote port.java.net.SocketcreateSocket(java.net.Socket s, 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.SocketcreateSocket(java.lang.String host, int port)Creates a socket and connects it to the specified remote host at the specified remote port.java.net.SocketcreateSocket(java.lang.String host, int port, java.net.InetAddress localHost, int localPort)Creates a socket and connects it to the specified remote host on the specified remote port.static javax.net.SocketFactorygetDefault()Returns a copy of the environment's default socket factory.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 created by this factory.
-
-
-
Field Detail
-
props
protected java.util.Properties props
-
default_constructor
protected boolean default_constructor
-
ldapConnectionInfo
protected java.util.Map ldapConnectionInfo
-
validateLdapConnectionInfo
protected static java.util.Map validateLdapConnectionInfo
-
-
Constructor Detail
-
SSLSocketFactory
public SSLSocketFactory()
This is the default constructor which will retrieve the default SSL configuration for creating Sockets. It first tries to find the javax.net.ssl.* properties and if not present will choose the default SSL configuration.
-
SSLSocketFactory
public SSLSocketFactory(java.lang.String alias)
This constructor allows you to pass in an SSL alias to retrieve an SSL configuration other than the default for creating Sockets. If the alias is not found, the default SSL configuration will be used.
- Parameters:
String- alias
-
SSLSocketFactory
public SSLSocketFactory(java.util.Properties sslprops)
This constructor allows you to pass in a set of SSL properties used for creating Sockets.
- Parameters:
java.util.Properties- sslprops
-
SSLSocketFactory
public SSLSocketFactory(java.lang.String alias, java.util.Map connectionInfo)This constructor allows you to pass in an SSL alias, and/or connectionInfo. depending upon what is available. You may specified null for any parameters. If the connectionInfo is specified, a check will be made to determine if a dynamic association between protocol/host/port has been made for this particular protocol and target host/port. If there is not dynamic association and an SSL alias is specified, a direct selection will occur. Finally, a group selection will occur where the localEndPoint (contained in the connectionInfo) will be used to determine if an SSL config is associated with that endpoint. If not, it will move up the topology to determine the next management scope that has an SSL configuration associated which this EndPoint falls under (e.g., server -> node -> cell, etc.).
- Parameters:
String- aliasjava.util.Map- connectionInfo- See Also:
JSSEHelper
-
-
Method Detail
-
getDefault
public static javax.net.SocketFactory getDefault()
Returns a copy of the environment's default socket factory.
-
getDefaultCipherSuites
public java.lang.String[] getDefaultCipherSuites()
Returns the list of cipher suites which are enabled by default.
- Specified by:
getDefaultCipherSuitesin classjavax.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 created by this factory.- Specified by:
getSupportedCipherSuitesin classjavax.net.ssl.SSLSocketFactory
-
createSocket
public java.net.Socket createSocket() throws java.io.IOExceptionCreates an unconnected socket.
- Overrides:
createSocketin classjavax.net.SocketFactory- Returns:
- java.net.Socket
- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose) throws java.io.IOException, java.net.UnknownHostExceptionReturns a socket layered over an existing socket connected to the named host, at the given port. The properties used to create the SSL socket are based upon the what was passed into the SSLSocketFactory constructor.
- Specified by:
createSocketin classjavax.net.ssl.SSLSocketFactory- Parameters:
java.net.Socket- s - existing socketString- host - target hostint- port - target portboolean- autoClose - close the underlying socket when this socket is closed- Returns:
- java.net.Socket
- Throws:
java.io.IOExceptionjava.net.UnknownHostException
-
createSocket
public java.net.Socket createSocket(java.net.InetAddress host, int port) throws java.io.IOExceptionCreates a socket and connects it to the specified port number at the specified address. The properties used to create the SSL socket are based upon the what was passed into the SSLSocketFactory constructor.
- Specified by:
createSocketin classjavax.net.SocketFactory- Parameters:
InetAddress- host - target hostint- port - target port- Returns:
- java.net.Socket
- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort) throws java.io.IOExceptionCreates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied. This socket is configured using the socket options established for this factory. The properties used to create the SSL socket are based upon the what was passed into the SSLSocketFactory constructor.
- Specified by:
createSocketin classjavax.net.SocketFactory- Parameters:
InetAddress- host - target hostint- port - target portInetAddress- localAddress - local hostint- localPort - local port- Returns:
- java.net.Socket
- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException, java.net.UnknownHostExceptionCreates a socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory. The properties used to create the SSL socket are based upon the what was passed into the SSLSocketFactory constructor.
- Specified by:
createSocketin classjavax.net.SocketFactory- Parameters:
InetAddress- host - target hostint- port - target portInetAddress- localAddress - local hostint- localPort - local port- Returns:
- java.net.Socket
- Throws:
java.io.IOExceptionjava.net.UnknownHostException
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localHost, int localPort) throws java.io.IOException, java.net.UnknownHostExceptionCreates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied. This socket is configured using the socket options established for this factory. The properties used to create the SSL socket are based upon the what was passed into the SSLSocketFactory constructor.
- Specified by:
createSocketin classjavax.net.SocketFactory- Parameters:
String- host - target hostint- port - target portInetAddress- localAddress - local hostint- localPort - local port- Returns:
- java.net.Socket
- Throws:
java.io.IOExceptionjava.net.UnknownHostException
-
compare
public int compare(javax.net.SocketFactory sf1, javax.net.SocketFactory sf2)
-
-