Exemplo n.º 1
0
    /** {@inheritDoc} */
    public void configure(HttpsParameters params) {
      // initialise the SSL context
      SSLEngine engine = context.createSSLEngine();
      // get the default parameters
      SSLParameters defaultSSLParameters = context.getDefaultSSLParameters();

      // Cert authentication is delayed later to the ClientCertAuthenticator
      params.setWantClientAuth(serverConfig.useSslClientAuthentication());
      defaultSSLParameters.setWantClientAuth(serverConfig.useSslClientAuthentication());

      // Cipher Suites
      params.setCipherSuites(serverConfig.getSSLCipherSuites());
      defaultSSLParameters.setCipherSuites(serverConfig.getSSLCipherSuites());

      // Protocols
      params.setProtocols(serverConfig.getSSLProtocols());
      defaultSSLParameters.setProtocols(serverConfig.getSSLProtocols());

      params.setSSLParameters(defaultSSLParameters);
    }
 /**
  * Constructs SSLParameters from the specified array of ciphersuites and protocols.
  *
  * <p>Calling this constructor is equivalent to calling the no-args constructor followed by {@code
  * setCipherSuites(cipherSuites); setProtocols(protocols);}.
  *
  * @param cipherSuites the array of ciphersuites (or null)
  * @param protocols the array of protocols (or null)
  */
 public SSLParameters(String[] cipherSuites, String[] protocols) {
   setCipherSuites(cipherSuites);
   setProtocols(protocols);
 }