So I updated to spring boot 3 and get this error. I looked up a few solution but the solutions all give me error. I tried the code below but it give me error on ".register(URIScheme.HTTPS.getId(), new SSLConnectionSocketFactory(sslContext))" where it expect ConnectionSocketFactory instead of SSLConnectionSocketFactory. Anyone know how to fix this issue?
Registry<ConnectionSocketFactory> socketRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
.register(URIScheme.HTTPS.getId(), new SSLConnectionSocketFactory(sslContext))
.register(URIScheme.HTTP.getId(), new PlainConnectionSocketFactory())
.build();
HttpClient httpClient = HttpClientBuilder.create()
.setConnectionManager(new PoolingHttpClientConnectionManager(socketRegistry))
.setConnectionManagerShared(true)
.build();
Also this is the original code that's causing issues.
HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).disableRedirectHandling().build();
Thank for any help!
I figured out the issue, the SSLConnectionSocketFactory import I had was not updated to httpclient5 version.