aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake" Watch "javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake" New topic
Author

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

Mark Heron
Greenhorn

Joined: Aug 19, 2010
Posts: 20
Hi,

I'm trying webservice security example(SSL and Mutual Authentication) from Ivan's study guide. Section 8.3 and 8.4. While running corrresponding client program I'm getting below error.

main, received EOFException: error
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
main, SEND TLSv1 ALERT: fatal, description = handshake_failure
main, WRITE: TLSv1 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 01 00 02 02 28 ......(
main, called closeSocket()
Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://localhost:8080/GreetingServletSSL/HelloWorldWSService?wsdl. It failed with:
Remote host closed connection during handshake.
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:151)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:133)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:254)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:217)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:165)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)
at javax.xml.ws.Service.<init>(Service.java:56)
at com.ivan.HelloWorldWSService.<init>(HelloWorldWSService.java:46)
at com.ivan.client.HelloWSClient.callService(HelloWSClient.java:60)
at com.ivan.client.HelloWSClient.main(HelloWSClient.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1120)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1147)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1131)
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.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at java.net.URL.openStream(URL.java:1010)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:793)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:251)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:118)
... 13 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
... 24 more

Access control example works fine for me. Does anybody get similar error? I will appreciate if someone knows how to solve this.

Thanks
Mark Heron
Greenhorn

Joined: Aug 19, 2010
Posts: 20
Hello,
I figured it out. The magic is in port number. I used HTTP port number 8080 instead of Secure HTTP port 8181 in WSDL location within generated service class. Have fun.

Regards
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1373
I used HTTP port number 8080 instead of Secure HTTP port 8181

Where do you define your port 8181 is secure HTTP (which file) ?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
The port to be used for secure communication (SSH) is defined in the server (GlassFish, Tomcat etc).
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Karthick Bala
Greenhorn

Joined: Dec 02, 2013
Posts: 1
Just change the https to http provided authentication is not needed / sufficient auth tokens are given


Regards,
Karthick
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake