Skip to content

Commit

Permalink
ssl: introduce SSLEngineConfigurator#setSSLParameters
Browse files Browse the repository at this point in the history
SSLParameters is a class introduced in java6 which can take over
SSLEngineConfigurator. As a first step, let allow applications to
use SSLParameters to configure SSLEngineConfigurator.

Signed-off-by: Tigran Mkrtchyan <[email protected]>
  • Loading branch information
kofemann committed Apr 10, 2019
1 parent 2dd28ae commit f2dbea2
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.logging.Logger;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import org.glassfish.grizzly.Grizzly;

/**
Expand Down Expand Up @@ -272,6 +273,21 @@ public SSLEngineConfigurator setWantClientAuth(boolean wantClientAuth) {
return this;
}

/**
* Apply {@link SSLParameters} to this SSLEngineConfigurator.
*
* @param sslParameters
* @return this SSLEngineConfigurator
*/
public SSLEngineConfigurator setSSLParameters(SSLParameters sslParameters) {
this.setEnabledCipherSuites(sslParameters.getCipherSuites());
this.setEnabledProtocols(sslParameters.getProtocols());
this.setNeedClientAuth(sslParameters.getNeedClientAuth());
this.setWantClientAuth(sslParameters.getWantClientAuth());

return this;
}

/**
* @return an array of enabled cipher suites. Modifications made on the array
* content won't be propagated to SSLEngineConfigurator
Expand Down

0 comments on commit f2dbea2

Please sign in to comment.