use of org.glassfish.admin.mbeanserver.JMXSslConfigHolder in project Payara by payara.
the class SecureRMIServerSocketFactory method createServerSocket.
@Override
public ServerSocket createServerSocket(int port) throws IOException {
// debug( "MyRMIServerSocketFactory.createServerSocket(): " + mAddress + " : " + port );
if (socketMap.containsKey(port)) {
return (ServerSocket) socketMap.get(port);
}
// plenty
final int backlog = 5;
// we use a custom class here. The reason is mentioned in the class.
final JMXSslConfigHolder sslConfigHolder;
try {
sslConfigHolder = new JMXSslConfigHolder(habitat, ssl);
} catch (SSLException ssle) {
throw new IllegalStateException(ssle);
}
final SSLContext context = sslConfigHolder.getSslContext();
ServerSocket sslSocket = context.getServerSocketFactory().createServerSocket(port, backlog, mAddress);
if (!(sslSocket instanceof SSLServerSocket)) {
throw new IllegalStateException("ServerSocketFactory returned non-secure server socket.");
}
configureSSLSocket((SSLServerSocket) sslSocket, sslConfigHolder);
Util.getLogger().log(Level.INFO, createdServerSocket, new Object[] { sslSocket.getLocalSocketAddress(), sslSocket.toString() });
// sslSocket.startHandshake();
// debug( "MyRMIServerSocketFactory.createServerSocket(): " + mAddress + " : " + port );
socketMap.put(port, sslSocket);
return sslSocket;
}
Aggregations