Class SSLSupport
java.lang.Object
org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport
Please note, this class supports PKCS#11 keystores, but there are no specific tests in the ActiveMQ Artemis
test-suite to validate/verify this works because this requires a functioning PKCS#11 provider which is not available
by default (see java.security.Security#getProviders()). The main thing to keep in mind is that PKCS#11 keystores
will either use null, and empty string, or NONE for their keystore path.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckPemProviderLoaded(String keystoreType) This method calls out to a separate class in order to avoid a hard dependency on the provider's implementation.io.netty.handler.ssl.SslContextio.netty.handler.ssl.SslContextgetValidProviderAndType(String storeProvider, String storeType) The changes ARTEMIS-3155 introduced an incompatibility with old clients using the keyStoreProvider and trustStoreProvider URL properties.booleanstatic KeyStoreloadKeystore(String keystoreProvider, String keystoreType, String keystorePath, String keystorePassword) static StringparseArrayIntoCommandSeparatedList(String[] suites) static String[]setCrlPath(String crlPath) setKeystoreAlias(String keystoreAlias) setKeystorePassword(String keystorePassword) setKeystorePath(String keystorePath) setKeystoreProvider(String keystoreProvider) setKeystoreType(String keystoreType) setSslProvider(String sslProvider) setTrustAll(boolean trustAll) setTrustManagerFactoryPlugin(String trustManagerFactoryPlugin) setTruststorePassword(String truststorePassword) setTruststorePath(String truststorePath) setTruststoreProvider(String truststoreProvider) setTruststoreType(String truststoreType)
-
Field Details
-
NONE
- See Also:
-
-
Constructor Details
-
SSLSupport
public SSLSupport() -
SSLSupport
-
-
Method Details
-
getKeystoreProvider
-
setKeystoreProvider
-
getKeystoreType
-
setKeystoreType
-
getKeystorePath
-
setKeystorePath
-
getKeystorePassword
-
setKeystorePassword
-
getKeystoreAlias
-
setKeystoreAlias
-
getTruststoreProvider
-
setTruststoreProvider
-
getTruststoreType
-
setTruststoreType
-
getTruststorePath
-
setTruststorePath
-
getTruststorePassword
-
setTruststorePassword
-
getCrlPath
-
setCrlPath
-
getSslProvider
-
setSslProvider
-
isTrustAll
public boolean isTrustAll() -
setTrustAll
-
getTrustManagerFactoryPlugin
-
setTrustManagerFactoryPlugin
-
createContext
- Throws:
Exception
-
createNettyContext
- Throws:
Exception
-
createNettyClientContext
- Throws:
Exception
-
parseCommaSeparatedListIntoArray
-
parseArrayIntoCommandSeparatedList
-
loadKeystore
public static KeyStore loadKeystore(String keystoreProvider, String keystoreType, String keystorePath, String keystorePassword) throws Exception - Throws:
Exception
-
checkPemProviderLoaded
This method calls out to a separate class in order to avoid a hard dependency on the provider's implementation. This allows folks who don't use PEM to avoid using the corresponding dependency. -
getValidProviderAndType
The changes ARTEMIS-3155 introduced an incompatibility with old clients using the keyStoreProvider and trustStoreProvider URL properties. These old clients use these properties to set the *type* of store (e.g. PKCS12, PKCS11, JKS, JCEKS, etc.), but new clients use these to set the *provider* (as the name implies). This method checks to see if the provider property matches what is expected from old clients and if so returns they proper provider and type properties to use with the new client implementation.- Returns:
- a
Pair<String, String>representing the provider and type to use (in that order)
-