SSLSocketFactorypublic class SSLSocketFactory extends Object implements org.apache.catalina.net.ServerSocketFactorySSL server socket factory. |
Fields Summary |
---|
static Logger | _logger | private static final boolean | clientAuth | private static com.sun.enterprise.util.LocalStringManagerImpl | localStrings | private SSLContext | context | private SSLServerSocketFactory | factory | private String[] | cipherSuites | private static SecureRandom | sr | private static KeyManager[] | keyManagers | private static TrustManager[] | trustManagers |
Constructors Summary |
---|
public SSLSocketFactory()Create the SSL socket factory. Initialize the key managers and
trust managers which are passed to the SSL context.
try {
if(keyManagers == null || trustManagers == null) {
SSLUtils.initStoresAtStartup();
}
context = SSLContext.getInstance("TLS");
context.init(keyManagers, trustManagers, sr);
factory = context.getServerSocketFactory();
cipherSuites = factory.getSupportedCipherSuites();
for(int i=0; i < cipherSuites.length; ++i) {
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,"Suite: " + cipherSuites[i]);
}
}
} catch(Exception e) {
_logger.log(Level.SEVERE,
"web_security.excep_sslsockfact", e.getMessage());
}
|
Methods Summary |
---|
public java.net.ServerSocket | createSocket(int port)Create the socket at the specified port.
SSLServerSocket socket =
(SSLServerSocket) factory.createServerSocket(port);
init(socket);
return socket;
| public java.net.ServerSocket | createSocket(int port, int backlog)Create the socket at the specified port.
SSLServerSocket socket = (SSLServerSocket)
factory.createServerSocket(port, backlog);
init(socket);
return socket;
| public java.net.ServerSocket | createSocket(int port, int backlog, java.net.InetAddress ifAddress)Create the socket at the specified port.
SSLServerSocket socket = (SSLServerSocket)
factory.createServerSocket(port, backlog, ifAddress);
init(socket);
return socket;
| private void | init(javax.net.ssl.SSLServerSocket socket)Specify whether the server will require client authentication.
// Some initialization goes here.....
// socket.setEnabledCipherSuites(cipherSuites);
socket.setNeedClientAuth(clientAuth);
| public static void | setManagers(javax.net.ssl.KeyManager[] kmgrs, javax.net.ssl.TrustManager[] tmgrs)
keyManagers = kmgrs;
trustManagers = tmgrs;
|
|