SslConfiguration ssl = session.getListener().getSslConfiguration();
if (ssl != null) {
session.setAttribute(SslFilter.DISABLE_ENCRYPTION_ONCE);
SslFilter sslFilter = new SslFilter(ssl.getSSLContext());
if (ssl.getClientAuth() == ClientAuth.NEED) {
sslFilter.setNeedClientAuth(true);
} else if (ssl.getClientAuth() == ClientAuth.WANT) {
sslFilter.setWantClientAuth(true);
}
// note that we do not care about the protocol, we allow both types
// and leave it to the SSL handshake to determine the protocol to
// use. Thus the type argument is ignored.
if (ssl.getEnabledCipherSuites() != null) {
sslFilter.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
}
session.getFilterChain().addFirst(SSL_SESSION_FILTER_NAME,
sslFilter);