我正在使用Asynhttpclient lib在android中执行api,这不允许'https'但它允许'http',它显示如下错误,
**Error :**
javax.net.ssl.SSLHandshakeException: Handshake failed
W: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:396)
W: at cz.msebera.android.httpclient.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:535)
W: at cz.msebera.android.httpclient.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:403)
W: at cz.msebera.android.httpclient.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:472)
W: at cz.msebera.android.httpclient.conn.scheme.SchemeSocketFactoryAdaptor.connectSocket(SchemeSocketFactoryAdaptor.java:65)
W: at cz.msebera.android.httpclient.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
W: at cz.msebera.android.httpclient.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:145)
W: at cz.msebera.android.httpclient.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131)
W: at cz.msebera.android.httpclient.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
W: at cz.msebera.android.httpclient.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
W: at cz.msebera.android.httpclient.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:860)
W: at cz.msebera.android.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
W: at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:146)
W: at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:177)
W: at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:106)
W: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
W: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
W: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
W: at java.lang.Thread.run(Thread.java:818)
W: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xb8635680: Failure in SSL library, usually a protocol error
W: error:100c5438:SSL routines:ssl3_read_bytes:TLSV1_ALERT_INTERNAL_ERROR (external/boringssl/src/ssl/s3_pkt.c:972 0xb86b88b8:0x00000001)
W: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
W: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:324)
W: ... 19 more
答案 0 :(得分:0)
logcat输出显示您尝试命中的网址没有正确的ssl certificate
,因此握手失败。只需检查浏览该网址或尝试卷曲它,您就会获得更多见解。