Hi, Richard,

Maybe it's Java6 causing the problem?  This looks suspicious:

Caused by: java.lang.NullPointerException
   at
com.sun.deploy.security.X509ExtendedDeployTrustManager.isSupportedAlgorithm(Unknown
Source)


Can you recreate the problem outside of httpclient?  (java.net.URL?)  Try
some test code to exercise the HttpsURLConnection.getDefaultSSLSocketFactory
:


public static void main( String[] args ) throws Exception {
   String host = args[ 0 ];

   SSLSocketFactory sf = HttpsURLConnection.getDefaultSSLSocketFactory();
   SSLSocket s = (SSLSocket) sf.createSocket();
   InetSocketAddress target = new InetSocketAddress( host, 443 );
   s.connect( target, 5000 ); // allow 5 seconds to connect
   OutputStream out = s.getOutputStream();
   InputStream in = s.getInputStream();

   // Send HTTP "HEAD /" request.
   StringBuffer buf = new StringBuffer();
   buf.append( "HEAD / HTTP/1.1\n\r" );
   buf.append( "Host: " + host + "\n\r" );
   buf.append( "\n\r" ); // \n\r\n\r is HTTP's "message terminator"
   out.write( buf.toString().getBytes( "UTF-8" ) );
   out.flush();

   // Read HTTP reply.
   byte[] reply = new byte[2048];
   int c = in.read( reply );

   // Shut down socket.
   out.close();
   in.close();
   s.close();

   System.out.println( new String( reply, 0, c ) );
}




On 12/12/06, Richard Suematsu <[EMAIL PROTECTED]> wrote:

Hi,

Does anybody run HttpClient with Java 6?  I'm running it with SSL and
with SocketFactoryWrapper.  I'm running a WebStart application.  I'm
getting the following error on the client.

Dec 12, 2006 4:16:21 PM org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry
INFO: I/O exception (javax.net.ssl.SSLException) caught when processing
request: java.lang.NullPointerException
Dec 12, 2006 4:16:21 PM org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry


javax.net.ssl.SSLException: java.lang.NullPointerException
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
    at java.io.BufferedOutputStream.flush(Unknown Source)
    at
org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(
HttpConnection.java:827)
    at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(
HttpMethodBase.java:1975)
    at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java
:993)
    at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(
HttpMethodDirector.java:397)
    at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(
HttpMethodDirector.java:170)
    at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java
:396)
    at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java
:324)
    at my.own.classes.i.probably.shouldnt.show
Caused by: java.lang.NullPointerException
    at

com.sun.deploy.security.X509ExtendedDeployTrustManager.isSupportedAlgorithm
(Unknown
Source)
    at
com.sun.deploy.security.X509ExtendedDeployTrustManager.checkServerTrusted
(Unknown
Source)
    at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
Source)
    at
com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
Source)
    at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown
Source)


I'm getting this in the ssl.log on the server:

[Tue Dec 12 16:11:03 2006] [info] Connection to child 248 established
(server SERVER21:443, client 192.168.0.36)
[Tue Dec 12 16:11:03 2006] [info] Seeding PRNG with 136 bytes of entropy
[Tue Dec 12 16:11:03 2006] [info] SSL library error 1 in handshake
(server SERVER21:443, client 192.168.0.36)
[Tue Dec 12 16:11:03 2006] [info] SSL Library Error: 336151608
error:14094438:SSL routines:SSL3_READ_BYTES:tlsv1 alert internal error
[Tue Dec 12 16:11:03 2006] [info] Connection to child 248 closed with
abortive shutdown(server SERVER21:443, client 192.168.0.36)


I should also say that this works fine with a Java5 client.  Any ideas?

--
Aloha,
Richard Suematsu
SynCaDD Systems, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
yours,

Julius Davies
416-652-0183
http://juliusdavies.ca/

Reply via email to