From 5b62930f33f136764dad22af46f9645e7df52a90 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 10 Nov 2016 10:40:47 +0100 Subject: [PATCH] Fix Quality flaw in sonar-ws/OkHttpClientBuilder --- .../java/org/sonarqube/ws/client/OkHttpClientBuilder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpClientBuilder.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpClientBuilder.java index 961d9e0da62..fafdd706941 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpClientBuilder.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpClientBuilder.java @@ -24,6 +24,11 @@ import java.io.IOException; import java.net.Proxy; import java.security.GeneralSecurityException; import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; import java.util.Arrays; import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; @@ -198,7 +203,8 @@ public class OkHttpClientBuilder { /** * Inspired from sun.security.ssl.SSLContextImpl#getDefaultKeyManager() */ - private static synchronized KeyManager[] getDefaultKeyManager() throws Exception { + private static synchronized KeyManager[] getDefaultKeyManager() throws KeyStoreException, NoSuchProviderException, + IOException, CertificateException, NoSuchAlgorithmException, UnrecoverableKeyException { final String defaultKeyStore = System.getProperty("javax.net.ssl.keyStore", ""); String defaultKeyStoreType = System.getProperty("javax.net.ssl.keyStoreType", KeyStore.getDefaultType()); String defaultKeyStoreProvider = System.getProperty("javax.net.ssl.keyStoreProvider", ""); -- 2.39.5