Ich habe einen Fehler beim Verzehr eines HTTPS -Webservice. Ich habe diesen Fehler beim Ausführen eines Clients in Java 6. Ich kann die Version des JDK nicht ändern. Ich habe es mit JDK8 ausprobiert und es funktioniert perfekt. < /P>
Was könnte diesen Fehler verursachen?
System.setProperty("javax.net.ssl.trustStore", "bci-to-scoring-keystore-client.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
//connection.setSSLSocketFactory(ssl.getSocketFactory());
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "text/xml");
connection.setHostnameVerifier(new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
connection.connect();
< /code>
Ausnahme: < /p>
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1822)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1004)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
at com.bci.test.JavaApplication7.execute(JavaApplication7.java:70)
at com.bci.test.JavaApplication7.main(JavaApplication7.java:33)
Beim Ausführen mit -djavax.net.debug = ssl Ich habe Folgendes:
Ich habe einen Fehler beim Verzehr eines HTTPS -Webservice. Ich habe diesen Fehler beim Ausführen eines Clients in Java 6. Ich kann die Version des JDK nicht ändern. Ich habe es mit JDK8 ausprobiert und es funktioniert perfekt. < /P> Was könnte diesen Fehler verursachen?[code] System.setProperty("javax.net.ssl.trustStore", "bci-to-scoring-keystore-client.jks"); System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
connection.setRequestProperty("Content-Type", "text/xml"); connection.setHostnameVerifier(new HostnameVerifier() { public boolean verify(String hostname, SSLSession session) { return true; } }); connection.connect(); < /code> Ausnahme: < /p> javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1822) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1004) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166) at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133) at com.bci.test.JavaApplication7.execute(JavaApplication7.java:70) at com.bci.test.JavaApplication7.main(JavaApplication7.java:33) [/code] Beim Ausführen mit -djavax.net.debug = ssl Ich habe Folgendes: [code]keyStore is : keyStore type is : jks keyStore provider is : init keystore init keymanager of type SunX509 trustStore is: bci-to-scoring-keystore-client.jks trustStore type is : jks trustStore provider is : init truststore adding as trusted cert: Subject: CN=*.BCITESTES.LOCAL, OU=DSI - Direccao de Sistemas de Informacao, O="BCI - Banco Comercial e de Investimentos, SA", L=Maputo, ST=Maputo, C=MZ Issuer: CN=BCI Enterprise Certificate Authority, DC=BCIFOMENTO, DC=CO, DC=MZ Algorithm: RSA; Serial number: 0x43000000b6661aefae5816d09c0002000000b6 Valid from Wed Jun 03 09:10:22 CAT 2020 until Fri Jun 03 09:10:22 CAT 2022
adding as trusted cert: Subject: CN=cliente.bci.scoring.co.mz, OU=DSI - Direccao de Sistemas de Informacao, O=BCI - Banco Comercial e de Investimentos, C=MZ, ST=Maputo, L=Maputo Issuer: CN=cliente.bci.scoring.co.mz, OU=DSI - Direccao de Sistemas de Informacao, O=BCI - Banco Comercial e de Investimentos, C=MZ, ST=Maputo, L=Maputo Algorithm: RSA; Serial number: 0x5f50ffd3 Valid from Thu Sep 03 16:38:11 CAT 2020 until Sat Aug 10 16:38:11 CAT 2120
Ich bin zuerst in automatisierten Tests. Ich habe also eine Aufgabe, ein automatisiertes Skript für API -Tests zu erstellen. Ich muss eine HTTPS-Anfrage mit selbstsignierter Serifikation erstellen....
Problem:
Ich war in der letzten Woche oder so versucht, meinen Scala+AKKA -Client so zu konfigurieren Ein Server, der nginx ausgeführt wird. javax.net.ssl.SSLHandshakeException:...
Bearbeiten: Ich habe versucht, die Frage zu formatieren und in meinem Blog eine anerkannte Antwort aufzeigbarer zu machen.
Hier ist das ursprüngliche Problem. fehlgeschlagen:...
Ich hoffe, das ist nicht zu vage eine Frage, aber ich habe weit und breit ausgesehen, aber es war nicht in der Lage, irgendetwas zu finden für diesen Fehler hilfreich.
Ich habe eine .NET 4.5.2 Web...