JiriOndrusek commented on code in PR #6241: URL: https://github.com/apache/camel-quarkus/pull/6241#discussion_r1671681873
########## 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 refactored the catch block and I',m catching only the exceptions related to initialization of provider. No unexpected exception is caught now. -- 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