放心 - 面临SSL问题 - 不受信任的资源

时间:2017-09-05 14:24:07

标签: ssl-certificate rest-assured

我试过以下事情 -  Ist thing - 使用-RestAssured.useRelaxedHTTPSValidation();  RestAssured.given()。proxy(ProxySpecification.host(" proxy.corp.ups.com")。withPort(8080).withAuth(User,Password))。when()。get(url); •获取状态代码为502 ...

2nd Thing-我从浏览器下载了PEM文件,然后使用它将其转换为.jks文件  $ keytool -importcert -alias" equifax-ca" -file EquifaxSecureGlobaleBusinessCA-1.crt -keystore truststore_javanet.jks -storepass test1234

然后使用  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( )获得(URL);

获取错误 - javax.net.ssl.SSLException:java.lang.RuntimeException:意外错误:java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空  at sun.security.ssl.Alerts.getSSLException(Unknown Source)

请帮我解决上述问题

1 个答案:

答案 0 :(得分:0)

我不确定这是不是我前面遇到的同样问题,但在我的情况下,我用这个命令解决了这个问题:

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

有关此内容的更多信息:https://brunozambiazi.wordpress.com/2016/01/19/java-security-invalidalgorithmparameterexception-the-trustanchors-parameter-must-be-non-empty/