在我的应用程序中,所有请求都是https,在ios版本上没有问题,但在Android上我遇到以下错误。
[ERROR] TiDownloadManager: javax.net.ssl.SSLException: Connection closed by peer
[ERROR] TiDownloadManager: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
[ERROR] TiDownloadManager: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)
[ERROR] TiDownloadManager: at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
[ERROR] TiDownloadManager: at com.android.okhttp.Connection.connect(Connection.java:107)
[ERROR] TiDownloadManager: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
[ERROR] TiDownloadManager: at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
[ERROR] TiDownloadManager: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
[ERROR] TiDownloadManager: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
[ERROR] TiDownloadManager: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
[ERROR] TiDownloadManager: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:179)
[ERROR] TiDownloadManager: at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:246)
[ERROR] TiDownloadManager: at java.net.URL.openStream(URL.java:470)
[ERROR] TiDownloadManager: at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:135)
[ERROR] TiDownloadManager: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
[ERROR] TiDownloadManager: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
[ERROR] TiDownloadManager: at java.lang.Thread.run(Thread.java:841)
在Genymotion模拟器上运行时会发生这种情况。