I have a rest webservice, which is being called by a java program. the rest service providers have given us a jwt token. and when i test this same in chrome (swagger) or postman client, it works fine. When i try to call it from java (webclient).the program throws an error:
javax.net.ssl.SSLHandshakeException: SSLHandshakeException invoking <rest path>: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
this is how it is called:
Response response = WebClient.create("url")
.accept(MediaType.TEXT_PLAIN).header(HttpHeaders.AUTHORIZATION, "Bearer "+ <jwt token>).header(HttpHeaders.CONTENT_TYPE, "application/json").get();
Have anybody faced this ?