Carlo ScarioniによるPro Spring Securityブックから、Spring ApplicationとCASサーバーを統合しようとしています。私はこの本が指示したすべてのステップに従ったが、それでも私はこのエラーで立ち往生している。私を助けてください。
SEVERE: Sun.security.validator.ValidatorException: PKIX path validation failed: Java.security.cert.CertPathValidatorException: signature check failed
javax.net.ssl.SSLHandshakeException: Sun.security.validator.ValidatorException: PKIX path validation failed: Java.security.cert.CertPathValidatorException: signature check failed
at Sun.security.ssl.Alerts.getSSLException(Alerts.Java:192)
at Sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.Java:1904)
at Sun.security.ssl.Handshaker.fatalSE(Handshaker.Java:279)
at Sun.security.ssl.Handshaker.fatalSE(Handshaker.Java:273)
at Sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.Java:1446)
at Sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.Java:209)
at Sun.security.ssl.Handshaker.processLoop(Handshaker.Java:901)
at Sun.security.ssl.Handshaker.process_record(Handshaker.Java:837)
at Sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.Java:1023)
at Sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.Java:1332)
at Sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.Java:1359)
at Sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.Java:1343)
at Sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.Java:563)
at Sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.Java:185)
at Sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.Java:1301)
at Sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.Java:254)
at org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.Java:311)
at org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.Java:291)
at org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator.retrieveResponseFromServer(AbstractCasProtocolUrlBasedTicketValidator.Java:32)
at org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.Java:187)
at org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticateNow(CasAuthenticationProvider.Java:140)
at org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticate(CasAuthenticationProvider.Java:126)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.Java:156)
at org.springframework.security.cas.web.CasAuthenticationFilter.attemptAuthentication(CasAuthenticationFilter.Java:242)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.Java:195)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.Java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.Java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.Java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.Java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.Java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.Java:167)
at org.Eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.Java:1336)
at org.Eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.Java:483)
at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:119)
at org.Eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.Java:524)
at org.Eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.Java:233)
at org.Eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.Java:1065)
at org.Eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.Java:412)
at org.Eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.Java:192)
at org.Eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.Java:999)
at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:117)
at org.Eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.Java:250)
at org.Eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.Java:149)
at org.Eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.Java:111)
at org.Eclipse.jetty.server.Server.handle(Server.Java:351)
at org.Eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.Java:454)
at org.Eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.Java:47)
at org.Eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.Java:890)
at org.Eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.Java:944)
at org.Eclipse.jetty.http.HttpParser.parseNext(HttpParser.Java:634)
at org.Eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.Java:230)
at org.Eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.Java:66)
at org.Eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.Java:254)
at org.Eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.Java:665)
at org.Eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.Java:599)
at org.Eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.Java:534)
at Java.lang.Thread.run(Thread.Java:745)
Caused by: Sun.security.validator.ValidatorException: PKIX path validation failed: Java.security.cert.CertPathValidatorException: signature check failed
at Sun.security.validator.PKIXValidator.doValidate(PKIXValidator.Java:350)
at Sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.Java:260)
at Sun.security.validator.Validator.validate(Validator.Java:260)
at Sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.Java:326)
at Sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.Java:231)
at Sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.Java:126)
at Sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.Java:1428)
... 55 more
Caused by: Java.security.cert.CertPathValidatorException: signature check failed
at Sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.Java:159)
at Sun.security.provider.certpath.PKIXCertPathValidator.doValidate(PKIXCertPathValidator.Java:347)
at Sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.Java:191)
at Java.security.cert.CertPathValidator.validate(CertPathValidator.Java:279)
at Sun.security.validator.PKIXValidator.doValidate(PKIXValidator.Java:345)
... 61 more
Caused by: Java.security.SignatureException: Signature does not match.
at Sun.security.x509.X509CertImpl.verify(X509CertImpl.Java:451)
at Sun.security.provider.certpath.BasicChecker.verifySignature(BasicChecker.Java:160)
at Sun.security.provider.certpath.BasicChecker.check(BasicChecker.Java:139)
at Sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.Java:133)
... 65 more
2015-08-29 02:46:50.472:WARN:oejs.ServletHandler:/j_spring_cas_security_check
Java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Sun.security.validator.ValidatorException: PKIX path validation failed: Java.security.cert.CertPathValidatorException: signature check failed
at org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.Java:328)
at org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.Java:291)
at org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator.retrieveResponseFromServer(AbstractCasProtocolUrlBasedTicketValidator.Java:32)
at org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.Java:187)
at org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticateNow(CasAuthenticationProvider.Java:140)
at org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticate(CasAuthenticationProvider.Java:126)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.Java:156)
at org.springframework.security.cas.web.CasAuthenticationFilter.attemptAuthentication(CasAuthenticationFilter.Java:242)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.Java:195)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.Java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.Java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.Java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.Java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.Java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.Java:167)
at org.Eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.Java:1336)
at org.Eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.Java:483)
at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:119)
at org.Eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.Java:524)
at org.Eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.Java:233)
at org.Eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.Java:1065)
at org.Eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.Java:412)
at org.Eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.Java:192)
at org.Eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.Java:999)
at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:117)
at org.Eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.Java:250)
at org.Eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.Java:149)
at org.Eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.Java:111)
at org.Eclipse.jetty.server.Server.handle(Server.Java:351)
at org.Eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.Java:454)
at org.Eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.Java:47)
at org.Eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.Java:890)
at org.Eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.Java:944)
at org.Eclipse.jetty.http.HttpParser.parseNext(HttpParser.Java:634)
at org.Eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.Java:230)
at org.Eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.Java:66)
at org.Eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.Java:254)
at org.Eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.Java:665)
at org.Eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.Java:599)
at org.Eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.Java:534)
at Java.lang.Thread.run(Thread.Java:745)
Casサーバーからcasクライアントへの通信(jarファイルはクライアントとして動作する)が行われない場合、SSLハンドシェイク例外が発生します。まず、両方のサーバー間の通信、ファイアウォール、ポートブロッキングなどのネットワークの問題を確認します。 SSL証明書のため、CASサーバーとクライアント(Springセキュリティアプリ)アプリケーションの両方で同じ証明書を使用してください。
まだコメントできないので、@ Kamalの答えに拡張します。私は同じ本で学んでいましたが、違いとしてTomcatを使用していましたので、Jettyを使用したことがないのと同じ答えを本当にあなたに与えることはできません:彼が言ったように、あなたのSSLは正常に機能していません。証明書はブラウザやサーバーで受け入れられていないため、認証できないため、SSLハンドシェイクは拒否されます。本(198-199)で説明されているように、証明書CAS.crt
をJVM cacertsに追加したことを確認し、それが正しいかどうかを確認する必要があります。そして、jetty-ssl.keystore
をJettyに追加し、使用したパスワードを使用して、正しい接続を確立できるようにする必要があります。また、cn名としてlocalhostと書かれていることを確認してくださいである必要があります。これは、環境(生産、テスト、学習だけ)に応じて変わりますが、これは、本で説明されているように機能させるために必要です。私はここから離れすぎないことを願っていますが、それが助けてくれることを願っています。