Volley SSL Handshake Exception虽然已经删除了SSL3协议 [英] Volley SSL Handshake Exception although has removed SSL3 protocol

查看:372
本文介绍了Volley SSL Handshake Exception虽然已经删除了SSL3协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作排球https请求,并且我使用了来自的代码这里删除SSL3协议并使用TLSv1.2 for android> = 4.4和TLS for Android< 4.4,但有时当我发出请求时会出现此错误:

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握手终止:
ssl = 0x606cfb30:SSL库失败,通常是协议错误

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

错误:1409443E:SSL例程:SSL3_READ_BYTES:tlsv1警报不合适
fallback(外部/ openssl / ssl / s3_pkt.c:1256 0x5fee2098:0x00000003)

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

任何人都可以提供帮助吗?

anybody can help ?

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

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.

推荐答案

最后,我自己发现,只是你的问题唱慢连接,所以当连接超时齐射握手失败时(凌空连接超时是如此之快),所以我尝试将Volley时间加到10000毫秒,如下所示:

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.

这篇关于Volley SSL Handshake Exception虽然已经删除了SSL3协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆