camel-quarkus icon indicating copy to clipboard operation
camel-quarkus copied to clipboard

NATS test certificate generator throws NoSuchFieldError id_MLDSA65_RSA4096_PSS_SHA512

Open jamesnetherton opened this issue 3 months ago • 2 comments

Bug description

This is likely related to the BouncyCastle 1.82 upgrade. When io.smallrye.certs.CertificateUtils attempts to generate certificates we see NoSuchFieldError thrown.

I think there's a clash between org.bouncycastle:bcprov-lts8on:2.73.7 pulled in by jnats, and org.bouncycastle:bcprov-jdk18on:1.82 required by the SmallRye certificate generator.

Excluding bcprov-lts8on seems to break jnats. So for now, I will disable the NATS TLS tests.

java.lang.NoSuchFieldError: Class org.bouncycastle.asn1.misc.MiscObjectIdentifiers does not have member field 'org.bouncycastle.asn1.ASN1ObjectIdentifier id_MLDSA65_RSA4096_PSS_SHA512'
	at org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder.<clinit>(Unknown Source)
	at org.bouncycastle.operator.jcajce.JcaContentSignerBuilder.<clinit>(Unknown Source)
	at io.smallrye.certs.CertificateUtils.generateCertificate(CertificateUtils.java:74)
	at io.smallrye.certs.CertificateHolder.<init>(CertificateHolder.java:33)
	at io.smallrye.certs.CertificateRequestManager.<init>(CertificateRequestManager.java:34)
	at io.smallrye.certs.CertificateGenerator.generate(CertificateGenerator.java:27)
	at org.apache.camel.quarkus.test.support.certificate.TestCertificateGenerationExtension.beforeAll(TestCertificateGenerationExtension.java:106)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	Suppressed: java.util.NoSuchElementException
		at java.base/java.util.ArrayDeque.removeFirst(ArrayDeque.java:361)
		at java.base/java.util.ArrayDeque.pop(ArrayDeque.java:592)
		at io.quarkus.test.junit.QuarkusTestExtension.afterAll(QuarkusTestExtension.java:1065)
		... 1 more

jamesnetherton avatar Sep 24 '25 11:09 jamesnetherton

https://www.bouncycastle.org/download/bouncy-castle-java-lts/?filter=java_lts%3Drelease-2-73-8

BC-LTS 2.73.8 is based off BC Java 1.81

apupier avatar Oct 15 '25 12:10 apupier

several commits related to BC Java 1.82 which are part of BC-LTS 2.73.9 (for instance https://github.com/bcgit/bc-lts-java/commit/55c711dc54022a15acc0efd1464df463645bce80 ) but no mention of it in the release notes https://www.bouncycastle.org/download/bouncy-castle-java-lts/?filter=java_lts%3Drelease-2-73-9

EDIT: there is still the same error when forcing the use of bcprov-lts8on to 2.73.9

apupier avatar Oct 15 '25 12:10 apupier