LOG.debug("truststorefile is null");
}
if (configuration.getPassphrase().toCharArray() == null) {
LOG.debug("passphrase is null");
}
SSLEngineFactory sslEngineFactory;
if (configuration.getKeyStoreFile() != null || configuration.getTrustStoreFile() != null) {
sslEngineFactory = new SSLEngineFactory(
configuration.getKeyStoreFormat(),
configuration.getSecurityProvider(),
configuration.getKeyStoreFile(),
configuration.getTrustStoreFile(),
configuration.getPassphrase().toCharArray());
} else {
ClassResolver resolver = consumer != null ? consumer.getContext().getClassResolver() : null;
sslEngineFactory = new SSLEngineFactory(resolver,
configuration.getKeyStoreFormat(),
configuration.getSecurityProvider(),
configuration.getKeyStoreResource(),
configuration.getTrustStoreResource(),
configuration.getPassphrase().toCharArray());
}
SSLEngine sslEngine = sslEngineFactory.createServerSSLEngine();
sslEngine.setUseClientMode(false);
sslEngine.setNeedClientAuth(configuration.isNeedClientAuth());
return new SslHandler(sslEngine);
}
}