Wednesday, June 19, 2013

[android help] Android 4.1.1 SSL Exception


Android 4.1.1 SSL Exception


Android 4.1.1 SSL Exception - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















We are having a problem related to ssl connection. The problem was the app cannot connect to the server using ssl connect after install it. But if kill the app and restart it, it worked. It only happens on android 4.1.1. Does anyone have the answer for this? Log listed below:



W/System.err(17335): javax.net.ssl.SSLException: Error setting private key: ssl=0x52f6aae0:
W/System.err(17335): error:140C10F7:SSL routines:SSL_SET_PKEY:unknown certificate type (external/openssl/ssl/ssl_rsa.c:189 0x40997bbc:0x00000000)
W/System.err(17335): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_use_OpenSSL_PrivateKey(Native Method)
W/System.err(17335): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.setCertificate(OpenSSLSocketImpl.java:471)
W/System.err(17335): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.clientCertificateRequested(OpenSSLSocketImpl.java:509)
06-17 17:02:03.682: W/System.err(17335): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)
06-17 17:02:03.682: W/System.err(17335): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:651)
W/System.err(17335): at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
W/System.err(17335): at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:191)
W/System.err(17335): at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:82)
W/System.err(17335): at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:174)
W/System.err(17335): at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:180)
W/System.err(17335): at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:235)
W/System.err(17335): at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:259)
W/System.err(17335): at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279)
W/System.err(17335): at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)
W/System.err(17335): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:435)
W/System.err(17335): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:592)
W/System.err(17335): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:510)
W/System.err(17335): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:488)


Thanks in advance.


Tao


EDIT: I have solved the problem by saving the certificate to local disk and reload it from local disk. Hope this help some one.



















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










default






.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...