Published on WSO2 Oxygen Tank (http://wso2.org)

HTTPS works fine but I get an IOException reading request on the server side

By erabelli
Created 2008-06-11 07:23

I am trying echo client to connect to echo service over HTTPS. It works fine -- meaning that service is echoing back the request message back to the client. However, I see the following exception trace at the service side:

 

DEBUG [2008-06-11 11:12:18,201]  IOException reading request
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLExcep
tion: java.net.SocketException: Connection reset
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.jav
a:1232)
        at com.sun.net.ssl.internal.ssl.AppInputStream.available(AppInputStream.
java:40)
        at org.apache.tomcat.util.net.TcpConnection.shutdownInput(TcpConnection.
java:90)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:681)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Connection rese
t
        at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1
584)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1
547)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketI
mpl.java:1511)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketI
mpl.java:1456)
        at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:
86)
        at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer
.java:737)
        at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(Interna
lInputBuffer.java:398)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:827)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:667)
        ... 4 more
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:168)
        at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:2
93)
        at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.j
ava:782)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketIm
pl.java:739)
        at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:
75)
        ... 8 more

 

Here is my client Code:

 

 

class EchoClient {static Logger logger = Logger.getLogger(EchoClient.class.getName());public static void main(String[] args) {"https://localhost:9443/services/echo";"WebContent\\WEB-INF\\conf\\log4j.properties";"WebContent\\WEB-INF";"WebContent\\WEB-INF\\conf\\axis2.xml";try {logger.info("Entering application.");// put your appropriate repository path in first arg, and path to client.axis2.xml in second arg. "javax.net.ssl.trustStore", "WebContent\\WEB-INF\\conf\\PingClient-TrustStore.jks");"javax.net.ssl.trustStoreType", "JKS");"javax.net.ssl.trustStorePassword", "password");new EchoStub(configContext, URL);"Hello There");out.println("Output: " + responseStr);catch (Exception e) {

 

 

 

 

EchoStub stub;

String URL =

 

String log4JProperties =

String configContextArg1 =

String configContextArg2 =

 

 

PropertyConfigurator.configure(log4JProperties);

 

 

 

 

ConfigurationContext configContext = ConfigurationContextFactory

.createConfigurationContextFromFileSystem(configContextArg1, configContextArg2);

 

System.setProperty(

System.setProperty(

System.setProperty(

 

stub =

 

EchoStringDocument echoStringDoc = EchoStringDocument.Factory.newInstance();

 

EchoStringDocument.EchoString echoString = echoStringDoc.addNewEchoString();

echoString.setIn(

 

echoStringDoc.setEchoString(echoString);

 

EchoStringResponseDocument response = stub.echoString(echoStringDoc);

 

String responseStr = response.getEchoStringResponse().getReturn();

System.

}

e.printStackTrace();

}

}

}

public

 


Source URL:
http://wso2.org/forum/thread/3692