Android 2.3.4 SSL问题

时间:2011-05-06 09:19:39

标签: java android ssl

升级到Android 2.3.4后,我遇到以下异常:

javax.net.ssl.SSLException: Read error: ssl=0x*: I/O error during system call, Connection timed out
 at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)
 at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:788)

早期版本的Android工作正常。任何提示?

1 个答案:

答案 0 :(得分:4)

我已明确指定SSL超时,一切正常:

val schemeRegistry = client.getConnectionManager.getSchemeRegistry
schemeRegistry.register(new Scheme("https", SSLCertificateSocketFactory.getHttpSocketFactory(timeout,
      new SSLSessionCache(context)), 443))