Package org.wildfly.security.auth.client
Class WildFlyElytronClientDefaultSSLContextProvider.ClientSSLContextProviderService
- java.lang.Object
-
- java.security.Provider.Service
-
- org.wildfly.security.auth.client.WildFlyElytronClientDefaultSSLContextProvider.ClientSSLContextProviderService
-
- Enclosing class:
- WildFlyElytronClientDefaultSSLContextProvider
private static final class WildFlyElytronClientDefaultSSLContextProvider.ClientSSLContextProviderService extends Provider.Service
-
-
Field Summary
Fields Modifier and Type Field Description (package private) String
configPath
private ThreadLocal<Integer>
entered
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
newInstance(Object ignored)
There is a risk of looping if the Elytron client configuration is invalid.void
setConfigPath(String configPath)
-
Methods inherited from class java.security.Provider.Service
getAlgorithm, getAttribute, getClassName, getProvider, getType, supportsParameter, toString
-
-
-
-
Field Detail
-
configPath
String configPath
-
entered
private final ThreadLocal<Integer> entered
-
-
Method Detail
-
setConfigPath
public void setConfigPath(String configPath)
-
newInstance
public Object newInstance(Object ignored) throws NoSuchAlgorithmException
There is a risk of looping if the Elytron client configuration is invalid. Loop will happen when Elytron client provider has configured default SSL context to be SSLContext::getDefault. Entered variable counts the number of entrances in order to avoid this loop. When it is equal or higher than 2 the NoSuchAlgorithmException will be thrown. When this exception is encountered, JVM tries to obtain default SSLContext from providers of lower priority and returns it to Elytron client as the default SSL context. Since we do not want to wrap the SSL context from other provider with this provider, we will throw an exception again which makes JVM escape this provider entirely and continue in the list of other providers.- Overrides:
newInstance
in classProvider.Service
- Throws:
NoSuchAlgorithmException
-
-