Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError when using FIPS enabled BouncyCastle #909

Open
brailsmt opened this issue May 21, 2024 · 0 comments
Open

NoClassDefFoundError when using FIPS enabled BouncyCastle #909

brailsmt opened this issue May 21, 2024 · 0 comments

Comments

@brailsmt
Copy link

brailsmt commented May 21, 2024

This error occurs when using FIPS enabled BouncyCastle libraries.

java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
        at net.lightbody.bmp.mitm.tools.DefaultSecurityProviderTool.<init>(DefaultSecurityProviderTool.java:34)
        at net.lightbody.bmp.mitm.util.TrustUtil.<clinit>(TrustUtil.java:56)
        at net.lightbody.bmp.mitm.TrustSource.javaTrustSource(TrustSource.java:103)
        at net.lightbody.bmp.mitm.TrustSource.<clinit>(TrustSource.java:39)
        at net.lightbody.bmp.BrowserMobProxyServer.<init>(BrowserMobProxyServer.java:225)

Snippet from pom.xml:

            <dependency>
                <groupId>net.lightbody.bmp</groupId>
                <artifactId>browsermob-core</artifactId>
                <version>2.1.5</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcprov-jdk15to18</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcpkix-jdk15to18</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcprov-jdk15on</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcpkix-jdk15on</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bc-fips</artifactId>
                <version>1.0.2.4</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcpkix-fips</artifactId>
                <version>1.0.7</version>
            </dependency>

There is a hardcoded reference to the non-FIPS BouncyCastleProvider here. This should be using java.security configuration for the JVM, as described in the BouncyCastle doc here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant