-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
What problem are you trying to solve?
In httpclient 5, setSSLSocketFactory is not available on the HttpClientBuilder anymore (also see this SO question with 35k views as of writing).
Instead the method is available on the HttpClientConnectionManager which can then be set on the builder HttpClientBuilder.setConnectionManager.
What precondition(s) should be checked before applying this recipe?
PoolingHttpClientConnectionManagerBuilder.setSSLSocketFactory is deprecated in httpclient5, so a version check may be needed in the future
Describe the situation before applying the recipe
class A {
void foo(String bar) {
SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(null);
CloseableHttpClient httpClient = HttpClientBuilder
.create()
.setSSLSocketFactory(sslSocketFactory)
.build();
}
}Describe the situation after applying the recipe
class A {
void foo(String bar) {
SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(null);
HttpClientConnectionManager connectionManager = PoolingHttpClientConnectionManagerBuilder
.create()
.setSSLSocketFactory(sslSocketFactory)
.build();
CloseableHttpClient httpClient = HttpClientBuilder
.create()
.setConnectionManager(connectionManager)
.build();
}
}Are you interested in contributing this recipe to OpenRewrite?
no
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Recipes Wanted