排球 SSL 握手异常虽然已删除 SSL3 协议

Volley SSL Handshake Exception although has removed SSL3 protocol

我想发起 volley https 请求,我已经使用 here 中的代码删除 SSL3 协议,并为 android >=4.4 使用 TLSv1.2,为 Android 使用 TLS <4.4,但有时当我发出请求时会出现此错误:

javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0x606cfb30: Failure in SSL library, usually a protocol error

error:1409443E:SSL routines:SSL3_READ_BYTES:tlsv1 alert inappropriate fallback (external/openssl/ssl/s3_pkt.c:1256 0x5fee2098:0x00000003)

有人可以帮忙吗?

注意:该错误仅出现在某些 Android 4.4 的设备中,某些其他 Android 4.4 的设备运行良好而没有该错误。

最后自己发现了,就是使用慢速连接时的问题,所以连接超时时volley handshake会失败(volley connection time out太快了),所以我尝试将Volley time out添加到10000 毫秒,像这样:

jsonRequest.setRetryPolicy(new DefaultRetryPolicy(10000,
                            DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
                            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

现在我的应用程序也能在使用慢速连接的设备上运行。