【发布时间】:2010-12-16 02:25:09
【问题描述】:
我在客户端使用 Spring RESTTemplate 来调用 REST 端点。在这种情况下,客户端是 Spring 应用程序,而 Tomcat 是 servlet 容器。
我在连接 HTTPS 端点时遇到问题。我收到一个错误,表明它找不到信任库的有效路径。我在哪里可以指定这个?这是在容器级别还是应用程序配置(Spring)级别完成的?
堆栈跟踪:
org.springframework.web.client.ResourceAccessException: I/O error:
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
org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:330)
org.springframework.web.client.RestTemplate.execute(RestTemplate.java:292)
org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:227)
【问题讨论】:
标签: java spring tomcat rest ssl