首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException:握手失败

com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException:握手失败
EN

Stack Overflow用户
提问于 2017-02-02 20:25:59
回答 3查看 3.3K关注 0票数 3

使用volley进行基本的网络操作,将项目作为模块添加时没有连接握手错误。

而该模块在另一个项目中运行良好。

在研发上,添加了重试策略,但没有用仍然得到相同的错误。

这是我的代码。https://gist.github.com/fizzysoftware/a895bc2cbd1ad9a048277859f3f23963

EN

回答 3

Stack Overflow用户

发布于 2017-02-02 20:44:09

这可能是以下两种情况之一:

  1. 您尝试连接到HTTPS url,但它实际上是一个HTTPS url,或者
  2. 您尝试连接到HTTPS页,但证书无效。

这些至少是我到目前为止遇到过的案例。

票数 4
EN

Stack Overflow用户

发布于 2018-12-11 17:40:05

将url从Https更改为Http将起作用。

票数 3
EN

Stack Overflow用户

发布于 2017-08-22 16:33:19

在我的项目中也面临着同样的问题。在棉花糖中,它的工作已经足够了。但在Kitkat版本中,它提出了这个问题

"com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException:握手失败“

为了处理这个问题,我使用了google的auth依赖项。请在Gradle中添加以下依赖项

代码语言:javascript
复制
compile 'com.google.android.gms:play-services-auth:11.0.2'

如果需要安装,请执行较低版本的Security Provider安装方法

代码语言:javascript
复制
private void updateAndroidSecurityProvider(Activity callingActivity) {
try {
    ProviderInstaller.installIfNeeded(this);
} catch (GooglePlayServicesRepairableException e) {
    // Thrown when Google Play Services is not installed, up-to-date, or enabled
    // Show dialog to allow users to install, update, or otherwise enable Google Play services.
    GooglePlayServicesUtil.getErrorDialog(e.getConnectionStatusCode(), callingActivity, 0);
} catch (GooglePlayServicesNotAvailableException e) {
    Log.e("SecurityException", "Google Play Services not available.");
}

}

然后在进行网络操作之前,在您的活动中调用该方法。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42002256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档