public String [ ] getEnabledCipherSuites ( SSLEngine sslEngine ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getEnabledCipherSuites" ) ; } String ciphers [ ] = null ; // First check the properties object for the ciphers. Object ciphersObject = this . myConfig . get ( Constants . SSLPROP_ENABLED_CIPHERS ) ; if ( null == ciphersObject ) { // Did not find the enabled ciphers. Need to determine them here. String securityLevel = this . myConfig . getProperty ( Constants . SSLPROP_SECURITY_LEVEL ) ; if ( null == securityLevel ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Defaulting to HIGH security level" ) ; } securityLevel = Constants . SECURITY_LEVEL_HIGH ; } // Found the security level. ciphers = Constants . adjustSupportedCiphersToSecurityLevel ( sslEngine . getSupportedCipherSuites ( ) , securityLevel ) ; } else { // Found enabled cipher suites. Now we need to put them in the right kind of object. if ( ciphersObject instanceof String ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "enabledCipherSuites is a String: " + ciphersObject ) ; } // Quickly break the string up into an array based on space delimiters. ciphers = ( ( String ) ciphersObject ) . split ( "\\s" ) ; } else if ( ciphersObject instanceof String [ ] ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "enabledCipherSuites is a String array" ) ; } ciphers = ( String [ ] ) ciphersObject ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Invalid object for enabledCipherSuites: " + ciphersObject ) ; } } } // check for when we're returning 0 ciphers as the connection will not // work and will be throwing errors later on if ( null == ciphers || 0 == ciphers . length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unable to find any enabled ciphers" ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getEnabledCipherSuites" ) ; } return ciphers ; }
Query the list of enabled cipher suites for this connection .