def connection = new URL( 'someURL.com')
.openConnection() as HttpURLConnection
connection.setRequestProperty( 'Accept', 'application/json' )
// get the response code - automatically sends the request
println connection.responseCode + ": " + connection.inputStream.text
I used this simple method to make REST call and I get the below error:
Caught: 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
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
at Example.findUserInUsamPGroup(findUserInUsamPGroup.groovy:33)
at Example.main(findUserInUsamPGroup.groovy:3)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
... 2 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
... 2 more
Could you suggest an easy way to bypass SSL certificate verification without having to use httpBuilder like this
Thanks for the help.