When migrating from httpclient 4.x to httpclient5. I was able to get all the packages sorted except for SSLContexts
. There is a line of code that we were using:
return SSLContexts.custom().useTLS().loadKeyMaterial(trustStore, trustStorePass.toCharArray()).loadTrustMaterial(trustStore, new TrustSelfSignedStrategy()).build();
But I looked at the jar, whatever documents I could find, there is no mention of the why this class was removed and what to use instead of this.
Also, looking inside the JAR, there is a package org.apache.hc.client5.http.impl.classic
, it does seem to refer to the old httpclient 4.x classes.
So just wanted to know:
What to use in place of SSLContexts
?
Is using classes from org.apache.hc.client5.http.impl.classic
the way forward, or should i write the classes from scratch using client5 classes? Or is my understanding of the package incorrect?
With so little documentation around this, left scratching my head! Any guidance will be helpful.
Thanks.
SSLContexts
, SSLContextBuilder
and friends got moved to the core module. One can find them in org.apache.hc.core5.ssl