0

I am updating the java version of our micro services from Java 11 to Java 17. In one of our micro services I have the following piece of code:

baseHttpClientBuilder.
.setProxyAuthenticationStrategy(INSTANCE)
...
...
.build()

where the HttpClientBuilder is org.apache.http.impl.client.HttpClientBuilder; and INSTANCE is

org.apache.http.impl.client.ProxyAuthenticationStrategy.INSTANCE

How should I replace this code, using the httpclient5 package, which is used in Spring Boot 3.x? There the HttpClientBuilder is org.apache.hc.client5.http.impl.classic.HttpClientBuilder

This builder has also

.setProxyAuthenticationStrategy(AuthenticationStrategy strategy)

method, but in the httpclient packages I do not see any ProxyAuthenticationStategy implementation classes, which I could use. ChatGPT said, that there is a class

org.apache.hc.client5.http.impl.classic.ProxyAuthenticationStrategy,

but I did not find any like this.

Ivajlo Iliev
  • 303
  • 1
  • 3
  • 19
  • One strategy would be to ask ChatGPT in which JAR the class can be found and check if that JAR is in the classpath – Ironluca Aug 28 '23 at 16:18

0 Answers0