我有两个应用程序部署在两个不同的服务器上,我的GUI应用程序在Tomcat上,CAS(中央身份验证)在Websphere上。我已经创建了密钥库文件,并在tomcat conf的server.xml中更新了该文件。
请查找以下条目。
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,但在它重定向到我的图形用户界面应用程序网址(即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发布于 2017-06-05 00:35:16
这只是您的客户端库执行严格的主机名验证,将URL中的"localhost“与WebSphere证书有效的主机进行比较。
最简单的解决方法是通过服务器的实际主机名而不是localhost来寻址该服务器。
https://stackoverflow.com/questions/44354717
复制相似问题