Websphere + Tomcat:CertificateException

问题描述:

我有2个应用程序部署在2台不同的服务器上,其中我的GUI 应用程序位于Websphere上的Tomcat和CAS(*身份验证)上。我创建了密钥库文件并在tomcat conf中的server.xml中进行了更新。Websphere + Tomcat:CertificateException

请在下面找到以下条目。

的Tomcat:

<Environment name="config/centralCasServerLoginURL" 
type="java.lang.String" value="https://localhost:9443/my-sso-web/login? 
method=POST"/> 
Tomcat: <Environment name="config/applicationServiceURL" 
type="java.lang.String" value="https://localhost:8443/bank-client- 
web/j_spring_cas_security_check"/>* 

<Connector SSLEnabled="true" clientAuth="false" 
keystoreFile="C:\tmp\newKeystore1" 
     keystorePass="password" maxThreads="200" port="8443" 
     protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" 
secure="true" sslProtocol="TLS"/>* 

我能够单独运行两个应用程序,但是当我在那个时候我才能够登录CAS配置CASAuthentication轮廓之后却重定向到我的GUI应用程序URL(即https://localhost:8443/bank-client-web/j_spring_cas_security_check),它正在抛出错误。

你能帮我解决吗?

SEVERE: Servlet.service() for servlet [default] in context with path [/bank- 
client-web] threw exception 
java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: 
java.security.cert.CertificateException: No name matching localhost found 
    at org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java:295) 
    at org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator.retrieveResponseFromServer(AbstractCasProtocolUrlBasedTicketValidator.java:33) 
    at org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:178) 
    at org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticateNow(CasAuthenticationProvider.java:131) 
    at org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticate(CasAuthenticationProvider.java:117) 
    at org.springframework.security.authentication.ProviderManager.doAuthentication(ProviderManager.java:130) 
Caused by: javax.net.ssl.SSLHandshakeException: 
java.security.cert.CertificateException: No name matching localhost found 
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) 
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) 
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)  
Caused by: java.security.cert.CertificateException: No name matching localhost found 
    at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:221) 
    at sun.security.util.HostnameChecker.match(HostnameChecker.java:95) 
    ... 55 more 

这仅仅是你的客户端库peforming严格主机名验证,在URL中的主机WebSphere的证书有效期为比较“localhost”的。

最简单的修复方法是通过它的实际主机名而不是本地主机来访问此服务器。

+0

嗨,谢谢你的回复。你能否详细说明一下。 – java

+0

我首先在URL下执行。它会重定向到下面列出的第二个URL。在这里,浏览器首先要求提供CAS凭据,然后凭证将重定向到GUI应用程序,并且在此处失败。我安装了CAS的websphere服务器也在本地机器上,因此我使用的是localhost。 1)https:// localhost:8443/bank-client-web/ 2)https:// localhost:9443/dcisc-sso-web/login?method = POST&service = https%3A%2F%2Flocalhost%3A8443% 2Fbank客户端的web%2Fj_spring_cas_security_check%3Bjsessionid%3D04318CA2CBDCACE83383342B5855DB78 – java