J'essaie de connecter une application Android avec un service distant HTTPS sécurisé hébergé dans Google App Engine pour Java (https://applicationname.appspot.com), en utilisant le Implémentation HTTPClient 4 fournie avec Android Le certificat est signé et valide * .appspot.com. J'utilise Android 2.1 dans un vrai appareil (HTC Hero), et j'obtiens l'erreur suivante: SSL23_GET_SERVER_HELLO:unknown protocol
.Échec de SSL SSL en essayant de se connecter avec GAE/Java
Cela fait partie de mon code:
HttpParams params = new BasicHttpParams();
...
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(
new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
schemeRegistry.register(
new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
..
ClientConnectionManager cm =
new ThreadSafeClientConnManager(params, schemeRegistry);
DefaultHttpClient result = new DefaultHttpClient(cm, params);
Toute idée de ce qui pourrait se produire et toute solution ou solution de contournement?
Ceci est la trace complète de la pile:
09-25 18:19:05.452: ERROR/OpenSSLSocketImpl(1195): Unknown error 1 during connect
09-25 18:19:05.460: ERROR/ServerProxy(1195): HTTPHelp : IOException : java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol error
09-25 18:19:05.460: ERROR/ServerProxy(1195): error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:585 0xaf586674:0x00000000)
09-25 18:19:05.460: ERROR/ServerProxy(1195): java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol error
09-25 18:19:05.460: ERROR/ServerProxy(1195): error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:585 0xaf586674:0x00000000)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:305)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocketImpl.java:502)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:443)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.io.SocketInputBuffer.<init>(SocketInputBuffer.java:93)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:83)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:170)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:106)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:129)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
09-25 18:19:05.460: ERROR/ServerProxy(1195): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
Merci beaucoup.
Avez-vous déjà trouvé une solution? Je suis confronté à ce problème en ce moment. – bszom