关于volley javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: 错误

01-22 19:41:30.647  32296-32296/com.hogehoge E/HogeClient javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: Failure in SSL library, usually a protocol error
    error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5d083d74:0x00000000)
    com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: Failure in SSL library, usually a protocol error
    error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5d083d74:0x00000000)
            at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:151)
            at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)
     Caused by: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: Failure in SSL library, usually a protocol error
    error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5d083d74:0x00000000)
            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:449)
            at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
            at com.android.okhttp.Connection.connect(Connection.java:107)
            at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
            at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
            at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
            at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:136)
            at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
            at com.hogehoge.network.MultiPartStack.performRequest(MultiPartStack.java:57)
            at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:96)
            ... 1 more
     Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x599e5468: Failure in SSL library, usually a protocol error
    error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5d083d74:0x00000000)
            at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:406)
            ... 13 more


这两天用Volley访问API,出现了一个很奇怪大问题,如上。上面问题 乍一看,肯定会认为是 https的问题,但是奇怪的是,在我访问api的时候,如果不加参数就可以正常访问,但只要加上参数就会报上面的错误,而且我觉得 我用的https 是可信任的,不应该出现上面问题的,尽管有怀疑,还是根据 网上 volley 访问https的方法进行修改,但是结果还是一样,最后的最后,我从一个小日本的网站上看到了和我一样的错误,于是就根据在线翻译,找到了问题,原来是因为超时,在代码中找到

DefaultRetryPolicy.java这个类,将

DEFAULT_TIMEOUT_MS 的值调大 我调到 5500,再试试就ok 了。



你可能感兴趣的:(android,volley)