[英]Websphere + Tomcat : CertificateException
我在2個不同的服務器上部署了2個應用程序,其中GUI應用程序在Tomcat上,Websphere上的CAS(中央身份驗證)。 我已經創建了密鑰庫文件,並在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"/>*
我可以分別運行兩個應用程序,但是當我在那時配置CASAuthentication配置文件時,我可以登錄CAS,但是將其重定向到我的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
這只是您的客戶端庫,它執行嚴格的主機名驗證,將URL中的“ localhost”與WebSphere證書所適用的主機進行比較。
最簡單的解決方法是通過服務器的實際主機名而不是本地主機來尋址。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.