"unable to find valid certification path to requested target", aber der browser sagt es ist OK
Entwickle ich eine Java-Anwendung, die Verbindung zum SOAP-Dienste ausgesetzt bei https://ut.eurodw.eu/ (test Umgebung für die Europäische data-Warehouse). Ich arbeite auf meiner Entwicklungs-Maschine, die vor kurzem neu formatiert mit Windows 8.1. Heute habe ich versucht, senden Sie eine Schöpfung Anfrage via SOAP von meinem Programm und habe diesen Fehler:
Caused by: javax.xml.ws.WebServiceException: Could not send Message.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
at com.sun.proxy.$Proxy110.createDeal(Unknown Source)
at it.csttech.edwin.services.spring.EdwinServiceImpl.createDeal(EdwinServiceImpl.java:102)
at it.csttech.edwin.consumercredit.data.managers.spring.DealManagerImpl.createEdCode(DealManagerImpl.java:319)
... 77 more
Caused by: javax.net.ssl.SSLHandshakeException: SSLHandshakeException invoking https://ut.eurodw.eu/edservices/2.2/DealService.svc: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1339)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1323)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:628)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
... 80 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)
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:1341)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153)
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:1016)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
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.getOutputStream(HttpURLConnection.java:1091)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:174)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1283)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1239)
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:201)
at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1296)
... 90 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
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:1323)
... 108 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
... 114 more
Wie Sie sehen können, indem Sie auf meinen link oben, das ist kein selbst-signiertes Zertifikat, aber veröffentlicht von GoDaddy öffentlichen ZERTIFIZIERUNGSSTELLE, anerkannt von meinem Firefox-browser. Meine Java version ist 1.7.0_60-b19
. Es wird ein schlechte Idee, den code zu modifizieren, um zu ermöglichen, unsichere SSL-verbindungen.
Ich würde gerne statt, um sicherzustellen, dass eurodw das Zertifikat in die trust store. Wie kann ich das überprüfen? Und wie kann ich ggf. ein neues Zertifikat importieren?
PS ich kann momentan nicht testen auf dem server, wo die Letzte Anwendung, die bereitgestellt wird: ich kann nur meine eigenen Tomcat-installation.
InformationsquelleAutor usr-local-ΕΨΗΕΛΩΝ | 2014-10-03
Du musst angemeldet sein, um einen Kommentar abzugeben.
Den verschiedenen Zertifikate finden Sie in der folgenden keystore :
%JAVA_HOME%/jre/lib/security/cacerts
Wenn Sie möchten, zur Liste der vertrauenswürdigen Zertifikate :
Das Passwort ist optionnal Liste.
Wenn Sie möchten, um einen Eintrag hinzuzufügen :
Erste, exportieren Sie das Zertifikat zu importieren, lassen Sie uns sagen, es wird c:\cert.crt. Der beste Weg, es zu tun ist firefox verwenden, klicken Sie rechts auf das Schloss-Bild in die url ein und nach wenigen Klicks haben Sie eine export-Funktion.
Geben :
Das Passwort ist : changeit
Den alias-Benutzer definierte Etikett, wählen Sie es mit bedacht, zu erinnern, wenn Sie es brauchen, eines Tages, was es war.
Mit all dem, sollten Sie in der Lage sein, um das Zertifikat und alles funktioniert wieder.
müssen Sie die doppelten Anführungszeichen, da @usr-local-sagte
Ich habe meine build.gradle-Datei und überprüft, was alle Repositorys Projekt zugreifen wollte, öffnete die URLs im browser und hat wie erwähnt von @Francois, versuchte es auf Ubuntu, neu gestartet-Android-studio-Projekt, und es funktionierte. Wenn Sie windows7, laufen keytool, Sie können gehen Sie auf ausführen, geben Sie cmd ein und drücken Sie Strg+Umschalt+EINGABETASTE. Dies öffnet die Eingabeaufforderung im administrator-Modus, dann suchen keytool.exe im java-Ordner.
InformationsquelleAutor Francois Laroche