mun*_*yso 3 java spring unirest spring-boot
您能否告诉我如何禁用使用 Unirest 作为休息客户端的证书验证。
我将 Unirest 与 Java Spring 结合使用。下面是我的源代码:
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());
}
Run Code Online (Sandbox Code Playgroud)
结果:
==================REST客户端错误:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath .SunCertPathBuilderException:无法找到请求目标的有效证书路径
| 归档时间: |
|
| 查看次数: |
5379 次 |
| 最近记录: |