/** * A utility method that implements the shared functionality of getClientModeSSLEngine and getServerModeSSLEngine. * * This method is used to initialize and pre-configure an instance of SSLEngine for a particular connection type. * The returned value lacks further configuration. In most cases, developers will want to use getClientModeSSLEngine * or getServerModeSSLEngine instead of this method. * * @return A new pre-configured SSLEngine instance (never null). */ private SSLEngine createSSLEngine() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException { final SSLContext sslContext = getSSLContext(); final SSLEngine sslEngine = sslContext.createSSLEngine(); // Configure protocol support. final Set<String> protocols = configuration.getEncryptionProtocols(); if ( !protocols.isEmpty() ) { // When an explicit list of enabled protocols is defined, use only those (otherwise, an implementation-specific default will be used). sslEngine.setEnabledProtocols( protocols.toArray( new String[ protocols.size() ] ) ); } // Configure cipher suite support. final Set<String> cipherSuites = configuration.getEncryptionCipherSuites(); if ( !cipherSuites.isEmpty() ) { // When an explicit list of enabled protocols is defined, use only those (otherwise, an implementation-specific default will be used).. sslEngine.setEnabledCipherSuites( cipherSuites.toArray( new String[ cipherSuites.size() ] ) ); } return sslEngine; }
final Set<String> protocols = configuration.getEncryptionProtocols(); if ( !protocols.isEmpty() )
/** * A utility method that implements the shared functionality of getClientModeSSLEngine and getServerModeSSLEngine. * * This method is used to initialize and pre-configure an instance of SSLEngine for a particular connection type. * The returned value lacks further configuration. In most cases, developers will want to use getClientModeSSLEngine * or getServerModeSSLEngine instead of this method. * * @return A new pre-configured SSLEngine instance (never null). */ private SSLEngine createSSLEngine() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException { final SSLContext sslContext = getSSLContext(); final SSLEngine sslEngine = sslContext.createSSLEngine(); // Configure protocol support. final Set<String> protocols = configuration.getEncryptionProtocols(); if ( !protocols.isEmpty() ) { // When an explicit list of enabled protocols is defined, use only those (otherwise, an implementation-specific default will be used). sslEngine.setEnabledProtocols( protocols.toArray( new String[ protocols.size() ] ) ); } // Configure cipher suite support. final Set<String> cipherSuites = configuration.getEncryptionCipherSuites(); if ( !cipherSuites.isEmpty() ) { // When an explicit list of enabled protocols is defined, use only those (otherwise, an implementation-specific default will be used).. sslEngine.setEnabledCipherSuites( cipherSuites.toArray( new String[ cipherSuites.size() ] ) ); } return sslEngine; }
final Set<String> protocols = configuration.getEncryptionProtocols(); if ( !protocols.isEmpty() )