Volley SSL Handshake Exception although has removed SSL3 protocol

天大地大妈咪最大 提交于 2019-12-23 19:17:35

问题


I want to make volley https request, and I have use code from here to remove SSL3 protocol and using TLSv1.2 for android >=4.4 and TLS for Android<4.4, but sometimes when I make request this error appear :

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)

anybody can help ?

Note : That error only appear in some device with Android 4.4, some other device with Android 4.4 is working well without that error.


回答1:


Finally, I found it by myself, that just the problem when using slow connection, so when the connection timeout volley handshake will failed (volley connection time out is so fast), so I try to added Volley time out to 10000 ms, like this :

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

And now my app working in device that use slow connection too.



来源:https://stackoverflow.com/questions/34259090/volley-ssl-handshake-exception-although-has-removed-ssl3-protocol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!