Skip to content

Commit

Permalink
SCANJLIB-232 Use the complete Bouncycastle provider
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Sep 12, 2024
1 parent b23a6f0 commit a019e9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
import okhttp3.JavaNetCookieJar;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonarsource.scanner.lib.ScannerProperties;
import org.sonarsource.scanner.lib.internal.http.ssl.CertificateStore;
import org.sonarsource.scanner.lib.internal.http.ssl.SonarBouncyCastlePKCS12Provider;
import org.sonarsource.scanner.lib.internal.http.ssl.SslConfig;

import static java.lang.Integer.parseInt;
Expand Down Expand Up @@ -186,12 +186,12 @@ private static SSLFactory configureSsl(SslConfig sslConfig) {
}
var trustStoreConfig = sslConfig.getTrustStore();
if (trustStoreConfig != null && Files.exists(trustStoreConfig.getPath())) {
Security.addProvider(new SonarBouncyCastlePKCS12Provider());
Security.addProvider(new BouncyCastleProvider());
KeyStore trustStore = KeyStoreUtils.loadKeyStore(
trustStoreConfig.getPath(),
trustStoreConfig.getKeyStorePassword().toCharArray(),
trustStoreConfig.getKeyStoreType(),
SonarBouncyCastlePKCS12Provider.NAME);
BouncyCastleProvider.PROVIDER_NAME);
sslFactoryBuilder.withTrustMaterial(trustStore);
}
return sslFactoryBuilder.build();
Expand Down

This file was deleted.

0 comments on commit a019e9d

Please sign in to comment.