从tomcat服务器中部署的grails Web应用程序发送https请求时出现SSL异常

时间:2014-10-01 12:13:35

标签: java tomcat grails ssl ssl-certificate

当从Tomcat服务器(8)中部署的Grails Web应用程序发送HTTPS请求时,我收到以下异常:

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

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

这是当我进行HTTPS调用时(在哪个点我得到此异常):

String URL = "https://**.**.**.**:8440/*****";
PostMethod postMethod = new PostMethod(URL);
client.executeMethod(postMethod);

我使用keytool命令创建了密钥库文件:

keytool -genkey -alias tomcat -keyalg RSA

并更改了Tomcat的server.xml文件,但仍然遇到此异常。这是我的Server.XML文件:

<Connector SSLEnabled="true" acceptCount="100" clientAuth="false" disableUploadTimeout="true" enableLookups="false" maxThreads="25"
           port="443" keystoreFile="/keystore/keystore.jks" keystorePass="password" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS" />   

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

我已经完成了以下可能的修复,但没有运气:

  1. http://java.dzone.com/articles/setting-ssl-tomcat-5-minutes
  2. https://tomcat.apache.org/tomcat-3.3-doc/tomcat-ssl-howto.html
  3. http://tomcat.apache.org/tomcat-4.1-doc/ssl-howto.html
  4. P.S。我只是想让tomcat允许我的应用程序点击URL的HTTPS请求:

     String URL = "https://**.**.**.**:8440/*****";
    

    我对此表示不满,但遗憾的是没有通过。请指导我可以解决这个问题?或者我做错了什么? 谢谢您的时间:)

0 个答案:

没有答案