Java7 Das Zertifikat im Trust Store wird nicht als vertrauenswürdig eingestuft

Ich habe ein komisches Problem - ein Anbieter verwendet TLS SSLv3 mit einem selbstsignierten Client- und Serverzertifikat. Bei Java1.5 und Java1.6 war dies kein Problem. Importieren Sie einfach das Client-Zertifikat und den privaten Schlüssel in einen Keystore und das öffentliche Zertifikat des Servers in den Truststore. Alles funktioniert gut. Bei Java7 wird das Serverzertifikat jedoch nicht als vertrauenswürdig eingestuft, obwohl derselbe Truststore verwendet wird. Ich habe versucht, Windows und Red Hat beide mit Java7 (1.7.03, 04 und 05, x86 und x64-Versionen) ohne Erfolg.

Ich habe den Keystore / Truststore von Grund auf neu erstellt und sie enthalten nur diese Zertifikate. Die entsprechenden Systemeigenschaften wurden festgelegt (javax.net.ssl.keyStore, javax.net.ssl.trustStore) und der Schlüsselaspekt ist, dass genau derselbe Code und dieselbe Konfiguration in JDK5 / 6 perfekt ausgeführt werden.

Ich bin ratlos - ich kann keinen Hinweis auf zusätzliche Prüfungen finden, aber ich hätte gedacht, dass die Tatsache, dass sich das Zertifikat im Truststore befindet, bedeuten sollte, dass es vertrauenswürdig ist, unabhängig davon, ob es selbst signiert ist.

Jede Hilfe dankbar. Anzeigen

Ausnahmeverfolgung:

Exception in thread "main" javax.net.ssl.SSLHandshakeException:     sun.security.validator.ValidatorException: PKIX path validation failed:     java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1868)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1338)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:154)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:998)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1294)
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:685)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:111)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
at com.alltria.ypsilon.testing.TestSSL.main(TestSSL.java:65)
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:350)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:249)
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:1320)
... 13 more
Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:208)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:279)
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:345)
... 19 more
Java Result: 1

Der Teil, bei dem das SSL-Debugging fehlschlägt, versucht, das Serverzertifikat zu validieren:

***
%% Invalidated:  [Session-1, SSL_RSA_WITH_RC4_128_SHA]
main, SEND SSLv3 ALERT:  fatal, description = certificate_unknown
main, WRITE: SSLv3 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 00 00 02 02 2E                               .......
main, called closeSocket()
main, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
main, called close()
main, called closeInternal(true)

Antworten auf die Frage(3)

Ihre Antwort auf die Frage