|
72 | 72 | import org.apache.cxf.version.Version; |
73 | 73 | import org.apache.cxf.ws.addressing.EndpointReferenceType; |
74 | 74 | import org.apache.hc.client5.http.async.HttpAsyncClient; |
75 | | -import org.apache.hc.client5.http.auth.AuthCache; |
76 | | -import org.apache.hc.client5.http.auth.AuthScheme; |
77 | 75 | import org.apache.hc.client5.http.auth.AuthSchemeFactory; |
78 | 76 | import org.apache.hc.client5.http.auth.AuthScope; |
79 | 77 | import org.apache.hc.client5.http.auth.Credentials; |
80 | 78 | import org.apache.hc.client5.http.auth.UsernamePasswordCredentials; |
81 | 79 | import org.apache.hc.client5.http.config.RequestConfig; |
82 | 80 | import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; |
| 81 | +import org.apache.hc.client5.http.impl.auth.BasicAuthCache; |
83 | 82 | import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider; |
84 | 83 | import org.apache.hc.client5.http.impl.auth.BasicScheme; |
85 | 84 | import org.apache.hc.client5.http.protocol.HttpClientContext; |
@@ -557,24 +556,9 @@ public Credentials getCredentials(final AuthScope authscope, HttpContext context |
557 | 556 |
|
558 | 557 | ctx.setCredentialsProvider(credsProvider); |
559 | 558 | if (proxyAuthorizationPolicy != null && proxyAuthorizationPolicy.getUserName() != null) { |
560 | | - // We only support BasicAuth |
561 | | - ctx.setAuthCache(new AuthCache() { |
562 | | - @Override |
563 | | - public void remove(HttpHost host) { |
564 | | - } |
565 | | - |
566 | | - @Override |
567 | | - public void put(HttpHost host, AuthScheme authScheme) { |
568 | | - } |
569 | | - @Override |
570 | | - public AuthScheme get(HttpHost host) { |
571 | | - return new BasicScheme(); |
572 | | - } |
573 | | - |
574 | | - @Override |
575 | | - public void clear() { |
576 | | - } |
577 | | - }); |
| 559 | + final BasicAuthCache cache = new BasicAuthCache(); |
| 560 | + cache.put(entity.getConfig().getProxy(), new BasicScheme()); |
| 561 | + ctx.setAuthCache(cache); |
578 | 562 | } |
579 | 563 |
|
580 | 564 | TlsStrategy tlsStrategy = null; |
|
0 commit comments