May you tell me the way to disable certificate verify for using Unirest as rest client.
I use Unirest with Java Spring. Below is my source code:
try {
HttpResponse<String> response = Unirest.post("myurl")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("my json data here")
.asJson();
} catch (Exception e) {
logger.info("==================REST CLIENT ERROR: "+e.getMessage());
}
The result:
==================REST CLIENT ERROR: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I know this thread is very old but just writing in case somebody else is looking for simpler way.
Unirest has now inbuilt support for this.
Unirest.config().verifySsl(false);
This worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With