【发布时间】:2014-04-22 17:52:42
【问题描述】:
我正在使用当前版本的 REST 客户端构建器插件。我通过 curl 测试了 uri:
curl --user username:password https://localhost:8085/rest/api/latest/plan.json?os_authType=basic
我得到了预期的 json 作为回报。当我尝试使用这样的插件将其翻译成 grails 时:
RestBuilder rb = new RestBuilder()
def response = rb.get("https://localhost:8085/rest/api/latest/plan.json?os_authType=basic"){
auth 'username', 'password'
}
response.json instanceof JSONObject
我收到此错误:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is 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
为什么它在 curl 中工作而不是在插件中工作?我如何让它发挥作用?
谢谢!
【问题讨论】:
-
谁在使用 Http 而不是 https ?