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

#782: Make runtime registration of bouncycastle skippable #828

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/net/schmizz/sshj/common/SecurityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ public static synchronized void setSecurityProvider(String securityProvider) {

private static void register() {
if (!registrationDone) {
if (securityProvider == null && (registerBouncyCastle == null || registerBouncyCastle)) {
if (System.getProperty("org.graalvm.nativeimage.imagecode") == null && securityProvider == null && (registerBouncyCastle == null || registerBouncyCastle)) {
registerSecurityProvider("org.bouncycastle.jce.provider.BouncyCastleProvider");
if (securityProvider == null && registerBouncyCastle == null) {
LOG.info("BouncyCastle not registered, using the default JCE provider");
} else if (securityProvider == null) {
LOG.error("Failed to register BouncyCastle as the defaut JCE provider");
throw new SSHRuntimeException("Failed to register BouncyCastle as the defaut JCE provider");
LOG.error("Failed to register BouncyCastle as the default JCE provider");
throw new SSHRuntimeException("Failed to register BouncyCastle as the default JCE provider");
}
}
registrationDone = true;
Expand Down