Skip to content

Commit 130665b

Browse files
authored
Update HttpClient.java
Add log for proxy authentication
1 parent 906de61 commit 130665b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/net/authorize/util/HttpClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ static CloseableHttpClient getHttpsClient() throws Exception {
345345
CloseableHttpClient httpClient;
346346

347347
if ( UseProxy && ProxyHost != null) {
348-
349-
LogHelper.info(logger, "Setting up proxy to URL: '%s://%s:%d'", Constants.PROXY_PROTOCOL, ProxyHost, ProxyPort);
348+
350349
HttpClientBuilder hcBuilder;
351350
if (proxyUsername != null && proxyPassword != null) {
351+
LogHelper.info(logger, "Setting up proxy to URL with Authentication: '%s://%s@%s:%d'", Constants.PROXY_PROTOCOL, proxyUsername, ProxyHost, ProxyPort);
352352
CredentialsProvider credsProvider = new BasicCredentialsProvider();
353353
AuthScope proxyScope = new AuthScope(ProxyHost, ProxyPort);
354354
Credentials proxyCreds = new UsernamePasswordCredentials(proxyUsername, proxyPassword);
@@ -360,6 +360,7 @@ static CloseableHttpClient getHttpsClient() throws Exception {
360360
.setDefaultCredentialsProvider(credsProvider);
361361
}
362362
else {
363+
LogHelper.info(logger, "Setting up proxy to URL: '%s://%s:%d'", Constants.PROXY_PROTOCOL, ProxyHost, ProxyPort);
363364
hcBuilder = HttpClients.custom()
364365
.setSSLSocketFactory(sslSocketFactory)
365366
.setDefaultRequestConfig(requestConfig)

0 commit comments

Comments
 (0)