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

com.android.volley.NoConnectionError:javax.net.ssl.SSLHandshakeException:握手失败,android,android-volley,handshake,sslhandshakeexception,Android,Android Volley,Handshake,Sslhandshakeexception,使用volley进行基本网络操作,在将项目作为模块添加时不会出现连接握手错误 而该模块在另一个项目中运行良好 在R&D方面,添加了retrypolicy,但仍然出现相同的错误是没有用的 这是我的密码。 可能是以下两种情况之一: 您尝试连接到HTTP url,但它实际上是HTTPS url,或者 您尝试连接到HTTPS页面,但证书无效 这些至少是我到目前为止遇到的案例…在我的项目中也面临同样的问题。在棉花糖中,它的工作效率很高。但在Kitkat版本中,它提出了这个问题 “com.android.v

使用volley进行基本网络操作,在将项目作为模块添加时不会出现连接握手错误

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

在R&D方面,添加了retrypolicy,但仍然出现相同的错误是没有用的

这是我的密码。
可能是以下两种情况之一:

  • 您尝试连接到HTTP url,但它实际上是HTTPS url,或者
  • 您尝试连接到HTTPS页面,但证书无效

  • 这些至少是我到目前为止遇到的案例…

    在我的项目中也面临同样的问题。在棉花糖中,它的工作效率很高。但在Kitkat版本中,它提出了这个问题

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

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

    compile 'com.google.android.gms:play-services-auth:11.0.2'
    
    如果需要安装,请在较低版本中实现安装安全提供程序的方法

    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.");
    }
    
    }


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

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

    不,实际上url仅为Https,在棉花糖版本中工作正常,但在kitkat中工作正常。您能否发布一些代码,让我们看看您如何尝试调用它。和logcat:)当然可以看到我编辑的问题。截取服务器错误我收到消息com.android.Volley.NoConnectionError:javax.net.ssl.SSLHandshakeException:Handshake failed我在将https更改为https时收到响应谢谢。我在http url中使用了https。现在问题解决了