ppalaga commented on code in PR #6241: URL: https://github.com/apache/camel-quarkus/pull/6241#discussion_r1670407257
########## extensions-support/bouncycastle/runtime/src/main/java/org/apache/camel/quarkus/support/bouncycastle/BouncyCastleRecorder.java: ########## @@ -35,11 +34,28 @@ public class BouncyCastleRecorder { public void registerBouncyCastleProvider(List<String> cipherTransformations, ShutdownContext shutdownContext) { Provider provider = Security.getProvider(SecurityProviderUtils.BOUNCYCASTLE_PROVIDER_NAME); + if (provider == null) { + provider = Security.getProvider(SecurityProviderUtils.BOUNCYCASTLE_FIPS_PROVIDER_NAME); + } if (provider == null) { // TODO: Fix BuildStep execution order so that this is not required // https://github.com/apache/camel-quarkus/issues/3472 - provider = new BouncyCastleProvider(); - Security.addProvider(provider); + try { + provider = (Provider) Thread.currentThread().getContextClassLoader() + .loadClass(SecurityProviderUtils.BOUNCYCASTLE_PROVIDER_CLASS_NAME).getConstructor().newInstance(); + Security.addProvider(provider); + } catch (Exception e) { Review Comment: I wonder whether it would not be better to catch something more specific here ClassNotFoundException or similar. Because Exception catches many other exceptions, such as NPE that we perhaps want to bubble up? -- 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: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org