protected SSLContext initializeSSLContext() {
SSLContext newSslContext = null;
try {
final ServerSocketFactory serverSF = getSslImplementation().getServerSocketFactory();
if (ssl != null) {
if (ssl.getCrlFile() != null) {
setAttribute(serverSF, "crlFile", ssl.getCrlFile(), null, null);
}
if (ssl.getTrustAlgorithm() != null) {
setAttribute(serverSF, "truststoreAlgorithm", ssl.getTrustAlgorithm(), null, null);
}
if (ssl.getKeyAlgorithm() != null) {
setAttribute(serverSF, "algorithm", ssl.getKeyAlgorithm(), null, null);
}
setAttribute(serverSF, "trustMaxCertLength", ssl.getTrustMaxCertLength(), null, null);
}
// key store settings
setAttribute(serverSF, "keystore", ssl != null ? ssl.getKeyStore() : null, "javax.net.ssl.keyStore", null);
setAttribute(serverSF, "keystoreType", ssl != null ? ssl.getKeyStoreType() : null, "javax.net.ssl.keyStoreType",
"JKS");
setAttribute(serverSF, "keystorePass", ssl != null ? getKeyStorePassword(ssl) : null,
"javax.net.ssl.keyStorePassword", "changeit");
// trust store settings
setAttribute(serverSF, "truststore", ssl != null ? ssl.getTrustStore() : null, "javax.net.ssl.trustStore",
null);
setAttribute(serverSF, "truststoreType", ssl != null ? ssl.getTrustStoreType() : null,
"javax.net.ssl.trustStoreType", "JKS");
setAttribute(serverSF, "truststorePass", ssl != null ? getTrustStorePassword(ssl) : null,
"javax.net.ssl.trustStorePassword", "changeit");
// cert nick name
serverSF.setAttribute("keyAlias", ssl != null ? ssl.getCertNickname() : null);
serverSF.init();
newSslContext = serverSF.getSSLContext();
CipherInfo.updateCiphers(newSslContext);
} catch (IOException e) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING,
LogMessages.WARNING_GRIZZLY_CONFIG_SSL_GENERAL_CONFIG_ERROR(),