jagpreet
jagpreet

Reputation: 1

Restassured - Facing issue with SSL - Untrusted Resources

I have tried following things- Ist thing - Using -RestAssured.useRelaxedHTTPSValidation(); RestAssured.given().proxy(ProxySpecification.host("proxy.corp.ups.com").withPort(8080).withAuth(User, Password)).when().get(url); •Getting Status code as 502...

2nd Thing- I downloaded the PEM file from Browser and then convert it into the .jks file using $ keytool -importcert -alias "equifax-ca" -file EquifaxSecureGlobaleBusinessCA-1.crt -keystore truststore_javanet.jks -storepass test1234

then using InputStream keyStoreStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("ABC.jks"); KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(keyStoreStream, "Password".toCharArray()); response = RestAssured.given().proxy(ProxySpecification.host("proxy.corp.ups.com").withPort(8080).withAuth(UName, Pwd)).trustStore(keyStore).when().get(url);

getting error - javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty at sun.security.ssl.Alerts.getSSLException(Unknown Source)

Please help me with the above issue

Upvotes: 0

Views: 527

Answers (1)

bruno.zambiazi
bruno.zambiazi

Reputation: 1482

I'm not sure if this is the same problem I faced sometime ago, but in my case I solved the issue with this command:

sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure

More on this here: https://brunozambiazi.wordpress.com/2016/01/19/java-security-invalidalgorithmparameterexception-the-trustanchors-parameter-must-be-non-empty/

Upvotes: 0

Related Questions