Hi,

I have an application that connects to an URL using https. It runs
fine on 1.5, 1.6 and 2.1. I tried to run it on 2.2 but I get the
following exception:

05-26 14:10:25.305: ERROR/NativeCrypto(285): Unknown error 5 during
connect
 java.io.IOException: SSL handshake failure: I/O error during system
call, Unknown error: 0
     at
org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native
Method)
     at
org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:
316)
     at
org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:
92)
     at
org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:
381)
     at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
164)
     at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
164)
     at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:
119)
     at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
348)
     at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
555)
     at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
487)
     at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
465)
         ...
     at android.os.AsyncTask$2.call(AsyncTask.java:185)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:
305)
     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
     at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1068)
     at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:561)
     at java.lang.Thread.run(Thread.java:1096)

This is the code:

SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http",
PlainSocketFactory.getSocketFactory(), 80));
schemeRegistry.register(new Scheme("https",
SSLSocketFactory.getSocketFactory(), 443));

HttpParams params = new BasicHttpParams();
HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
HttpProtocolParams.setUseExpectContinue(params, false);

ClientConnectionManager cm = new ThreadSafeClientConnManager(params,
schemeRegistry);
httpClient = new DefaultHttpClient(cm, params);

try {
        HttpUriRequest httpUriRequest = ......
        //Works on 1.5, 1.6, 2.1
        //Throws the exception on 2.2
        HttpResponse httpResponse = httpClient.execute(httpUriRequest);
        ...
} catch (IOException e){
        ...
}


As you can see, I'm using the default httpclient and
connectionmanager. It is hard to debug because I don't have the source
code. Has anything changed in the SSL implementation? Is there a
solution/workaround? Or is this just a plain bug I need to report?

Thnx in advance

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to