public static void removeEntryFromSSLContextMap ( String keyStorePath ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "removeEntryFromSSLContextMap: " + new Object [ ] { keyStorePath } ) ; List < SSLConfig > removeList = new ArrayList < SSLConfig > ( ) ; for ( Entry < SSLConfig , SSLContext > entry : sslContextCacheJAVAX . entrySet ( ) ) { SSLConfig cachedConfig = entry . getKey ( ) ; if ( cachedConfig != null ) { String ksPropValue = cachedConfig . getProperty ( Constants . SSLPROP_KEY_STORE , null ) ; boolean ksFileBased = Boolean . parseBoolean ( cachedConfig . getProperty ( Constants . SSLPROP_KEY_STORE_FILE_BASED ) ) ; String tsPropValue = cachedConfig . getProperty ( Constants . SSLPROP_TRUST_STORE , null ) ; boolean tsFileBased = Boolean . parseBoolean ( cachedConfig . getProperty ( Constants . SSLPROP_TRUST_STORE_FILE_BASED ) ) ; if ( ( ksPropValue != null && keyStorePath . equals ( WSKeyStore . getCannonicalPath ( ksPropValue , ksFileBased ) ) ) || ( tsPropValue != null && keyStorePath . equals ( WSKeyStore . getCannonicalPath ( tsPropValue , tsFileBased ) ) ) ) { removeList . add ( cachedConfig ) ; } } } if ( ! removeList . isEmpty ( ) ) { for ( SSLConfig removeEntry : removeList ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "removing from sslContext cache: " + removeEntry . toString ( ) ) ; sslContextCacheJAVAX . remove ( removeEntry ) ; } } }
Give a keyStoreFile location look for the SSLContexts that reference it as either a keystore or truststore then remove those SSLContexts from the cache .