jbertram commented on code in PR #5547: URL: https://github.com/apache/activemq-artemis/pull/5547#discussion_r1983496876
########## artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java: ########## @@ -352,10 +354,15 @@ public static KeyStore loadKeystore(final String keystoreProvider, return ks; } - public static void checkPemProviderLoaded(String keystoreType) { + /** + * This method uses reflection to load the appropriate java.security.Provider for PEM use-cases. Reflection is used + * to avoid a hard dependency on the provider's implementation so that folks who don't use PEM don't have to include + * the corresponding dependency. + */ + public static void checkPemProviderLoaded(String keystoreType) throws Exception { if (keystoreType != null && keystoreType.startsWith("PEM")) { if (Security.getProvider("PEM") == null) { - Security.insertProviderAt(new de.dentrassi.crypto.pem.PemKeyStoreProvider(), + Security.insertProviderAt((Provider) Class.forName(PEM_PROVIDER).getDeclaredConstructor().newInstance(), Review Comment: I like that solution, @gemmellr. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact