aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src
diff options
context:
space:
mode:
authorWojtek Wajerowicz <115081248+wojciech-wajerowicz-sonarsource@users.noreply.github.com>2023-11-07 14:16:43 +0100
committersonartech <sonartech@sonarsource.com>2023-11-08 20:02:51 +0000
commit3c40fffa36a740785892e8963916b07b4a5faed5 (patch)
tree714de58d7cd7e06ee6847dfde646932b7e7b58c9 /sonar-scanner-engine/src
parent6c525fc50c21c84015497eb31ab8ef47aece1e2e (diff)
downloadsonarqube-3c40fffa36a740785892e8963916b07b4a5faed5.tar.gz
sonarqube-3c40fffa36a740785892e8963916b07b4a5faed5.zip
SONAR-20540 Use proxy settings in DefaultHttpDownloader
Diffstat (limited to 'sonar-scanner-engine/src')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java
index c38ad36fd31..098cc0b19c2 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java
@@ -30,6 +30,8 @@ import org.springframework.context.annotation.Bean;
import static java.lang.Integer.parseInt;
import static java.lang.String.valueOf;
import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.sonar.core.config.ProxyProperties.HTTP_PROXY_PASSWORD;
+import static org.sonar.core.config.ProxyProperties.HTTP_PROXY_USER;
public class ScannerWsClientProvider {
static final int CONNECT_TIMEOUT_MS = 5_000;
@@ -56,9 +58,9 @@ public class ScannerWsClientProvider {
.credentials(login, scannerProps.property(CoreProperties.PASSWORD));
// OkHttp detect 'http.proxyHost' java property, but credentials should be filled
- final String proxyUser = System.getProperty("http.proxyUser", "");
+ final String proxyUser = System.getProperty(HTTP_PROXY_USER, "");
if (!proxyUser.isEmpty()) {
- connectorBuilder.proxyCredentials(proxyUser, System.getProperty("http.proxyPassword"));
+ connectorBuilder.proxyCredentials(proxyUser, System.getProperty(HTTP_PROXY_PASSWORD));
}
return new DefaultScannerWsClient(WsClientFactories.getDefault().newClient(connectorBuilder.build()), login != null,