commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph.He...@spb.de
Subject [HTTP Client] Exception "java.net.SocketException: Socket closed" while processing HTTPS request
Date Mon, 05 Apr 2004 10:12:08 GMT
Hello,

I'm experiencing a problem while processing a HTTPS Get Request with HTTP
Client and IBM JSSE 1.4 (part of WebSphere App Server 5.0)
When working on plain secure sockets all works fine.
When I try do use HTTP Client the following exception occurs:

java.net.SocketException: Socket closed
        at java.net.PlainSocketImpl.socketGetOption(Native Method)
        at java.net.PlainSocketImpl.getOption(PlainSocketImpl.java:214)
        at java.net.Socket.getSendBufferSize(Socket.java:548)
        at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:720)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:662)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
        at SSLTest2.main(SSLTest2.java:31)

My code is:
        [...]
        System.setProperty("java.protocol.handler.pkgs",
"com.ibm.net.ssl.internal.www.protocol");
        System.setProperty("javax.net.ssl.keyStorePassword", KEYSTOREPW);
        java.security.Security.addProvider(new com.ibm.jsse.IBMJSSEProvider
());

        try
        {
           HttpClient httpclient = new HttpClient();
           GetMethod httpget = new GetMethod(TARGET_HTTPS_URL);
           httpclient.executeMethod(httpget);
           System.out.println(httpget.getStatusLine().toString());
        }
        catch(Exception e)
        {
           e.printStackTrace();
        }
        [...]

The HTTP Client trace output looks like:

2004/04/05 11:34:52:031 CEST [TRACE] GetMethod - -enter GetMethod(String)
2004/04/05 11:34:52:031 CEST [TRACE] HttpClient - -enter
HttpClient.executeMethod(HttpMethod)
2004/04/05 11:34:52:031 CEST [TRACE] HttpClient - -enter
HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
2004/04/05 11:34:52:047 CEST [DEBUG] HttpConnection -
-HttpConnection.setSoTimeout(0)
2004/04/05 11:34:52:047 CEST [TRACE] HttpConnection - -enter
HttpConnection.open()
2004/04/05 11:34:54:688 CEST [TRACE] HttpConnection - -enter
HttpConnection.closeSockedAndStreams()
2004/04/05 11:34:54:688 CEST [TRACE] HttpConnection - -enter
HttpConnection.releaseConnection()

Can anyone help?
Thanks in advance.

Ralph Henze.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message