Hello
I'm willing to connect to a HTTPS server who only operates with the
SSLv23 protocol.
But, using Android 1.0 SDK, all attempt to connect to the server using
HttpsURLConnection fails with the following exception (see at the end
of this message for complete trackback):
12-01 11:54:14.140: WARN/System.err(174): java.io.IOException: SSL
handshake failure: Failure in SSL library, usually a protocol error
12-01 11:54:14.140: WARN/System.err(174): error:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protocol (extlibs/
openssl-0.9.8h/ssl/s23_clnt.c:585 0xaf58a238:0x00000000)
If I try with SSLContext, the exception is thrown exactly at the
moment getInstance is called with the following statements:
SSLContext.getInstance("SSL");
SSLContext.getInstance("SSLv23");
SSLContext.getInstance("SSL23");
So, what I understand from the error message, is that SSL algorithm is
not supported by the SSLContext object. Maybe should I import a
special package, or something like this, but I don't know what
exactly.
Searching on forum didn't helped me a lot, there is no a clear
solution, or if there is, I'll be please to try them.
I've also tried several other approches, trying to force using TLS
with SSLContext.getInstance("TLS") but the server seems to really want
SSL, the subsequent connect fails with the abrove exception.
I'm not a SSL specialist, and never used it with Java, so I might not
do the right thing, but I can't know what.
So far I'm using a webbrowser to go to this Url, but launching a
webbrowser activity from a service is not exactly the most beautiful
code I ever did. I also tryed with a "hidden" webview, but this
doesn't cross my proxy, althrought all HttpURLConnection and
webbrowser do go throught the proxy correctly (I don't think my
problem is due to the proxy configuration, because of the exception on
the very call of SSLContext.getInstance).
Thanks for all your help
Gaetan
Complete trackback:
12-01 11:54:14.140: WARN/System.err(174): java.io.IOException: SSL
handshake failure: Failure in SSL library, usually a protocol error
12-01 11:54:14.140: WARN/System.err(174): error:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protocol (extlibs/
openssl-0.9.8h/ssl/s23_clnt.c:585 0xaf58a238:0x00000000)
12-01 11:54:14.140: WARN/System.err(174): at
org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect
(Native Method)
12-01 11:54:14.150: WARN/System.err(174): at
org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake
(OpenSSLSocketImpl.java:333)
12-01 11:54:14.159: WARN/System.err(174): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.getSecureSocket
(HttpConnection.java:167)
12-01 11:54:14.159: WARN/System.err(174): at
org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection
$HttpsEngine.connect(HttpsURLConnection.java:398)
12-01 11:54:14.169: WARN/System.err(174): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream
(HttpURLConnection.java:1129)
12-01 11:54:14.179: WARN/System.err(174): at
org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection.getOutputStream
(HttpsURLConnection.java:262)
12-01 11:54:14.179: WARN/System.err(174): at
com.motorola.socialnetworksdemo.FacebookInterface.doFakeLogin
(FacebookInterface.java:497)
12-01 11:54:14.189: WARN/System.err(174): at
com.motorola.socialnetworksdemo.FacebookInterface.connectToFacebook
(FacebookInterface.java:150)
12-01 11:54:14.189: WARN/System.err(174): at
com.motorola.socialnetworksdemo.FacebookInterface.<init>
(FacebookInterface.java:85)
12-01 11:54:14.199: WARN/System.err(174): at
com.motorola.socialnetworksdemo.SocialNetworks.getInterface
(SocialNetworks.java:40)
12-01 11:54:14.210: WARN/System.err(174): at
com.motorola.socialnetworksdemo.SocialNetworksService$1.run
(SocialNetworksService.java:103)
12-01 11:54:14.210: WARN/System.err(174): at java.lang.Thread.run
(Thread.java:935)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---