public void updateHTTPSSettingsFromContext ( SSLContext sslContext ) { SSLParameters parameters = sslContext . getSupportedSSLParameters ( ) ; // Protocols if ( sslProtocols == null ) { sslProtocols = parameters . getProtocols ( ) ; } else { List < String > supportedProtocols = Arrays . asList ( parameters . getProtocols ( ) ) ; List < String > sslProtocolsList = new ArrayList < String > ( Arrays . asList ( sslProtocols ) ) ; Iterator < String > pit = sslProtocolsList . iterator ( ) ; while ( pit . hasNext ( ) ) { String protocol = pit . next ( ) ; if ( ! supportedProtocols . contains ( protocol ) ) { System . out . println ( "Jolokia: Discarding unsupported protocol: " + protocol ) ; pit . remove ( ) ; } } sslProtocols = sslProtocolsList . toArray ( new String [ 0 ] ) ; } // Cipher Suites if ( sslCipherSuites == null ) { sslCipherSuites = parameters . getCipherSuites ( ) ; } else { List < String > supportedCipherSuites = Arrays . asList ( parameters . getCipherSuites ( ) ) ; List < String > sslCipherSuitesList = new ArrayList < String > ( Arrays . asList ( sslCipherSuites ) ) ; Iterator < String > cit = sslCipherSuitesList . iterator ( ) ; while ( cit . hasNext ( ) ) { String cipher = cit . next ( ) ; if ( ! supportedCipherSuites . contains ( cipher ) ) { System . out . println ( "Jolokia: Discarding unsupported cipher suite: " + cipher ) ; cit . remove ( ) ; } } sslCipherSuites = sslCipherSuitesList . toArray ( new String [ 0 ] ) ; } }
Filter the list of protocols and ciphers to those supported by the given SSLContext