Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
com.android.volley.error.NoConnectionError:javax.net.ssl.SSLHandshakeException:握手失败,仅在牛轧糖设备中_Android_Ssl Certificate_Android Volley - Fatal编程技术网

com.android.volley.error.NoConnectionError:javax.net.ssl.SSLHandshakeException:握手失败,仅在牛轧糖设备中

com.android.volley.error.NoConnectionError:javax.net.ssl.SSLHandshakeException:握手失败,仅在牛轧糖设备中,android,ssl-certificate,android-volley,Android,Ssl Certificate,Android Volley,应用程序在操作系统版本低于牛轧糖的设备中正常工作。 已提供服务器的证书(使用firefox下载) 异常原因: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xabad5f00: Failure in SSL library, usually a protocol error 03-03 20:54:52.507 12993-12993/com.mummysocial W/System.e

应用程序在操作系统版本低于牛轧糖的设备中正常工作。 已提供服务器的证书(使用firefox下载)

异常原因:

Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xabad5f00: Failure in SSL library, usually a protocol error
03-03 20:54:52.507 12993-12993/com.mummysocial W/System.err:  error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE  (external/boringssl/src/ssl/s3_pkt.c:610 0xaba93a80:0x00000001)
 03-03 20:54:52.507 12993-12993/com.mummysocial W/System.err:  error:1000009a:SSL routines:OPENSSL_internal:HANDSHAKE_FAILURE_ON_CLIENT_HELLO  (external/boringssl/src/ssl/s3_clnt.c:764 0xa7dc5912:0x00000000)
 03-03 20:54:52.507 12993-12993/com.mummysocial W/System.err:     at  com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
  03-03 20:54:52.507 12993-12993/com.mummysocial W/System.err:     at    com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java :357)
03-03 20:54:52.507 12993-12993/com.mummysocial W/System.err:            ... 17 more
 03-03 20:54:52.507 12993-12993/com.mummysocial W/System.err:   Caused by:  javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xabad5f00:  Failure in SSL library, usually a protocol error
  03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err:  error:1000043e:SSL routines:OPENSSL_internal:TLSV1_ALERT_INAPPROPRIATE_FALLBACK  (external/boringssl/src/ssl/s3_pkt.c:610 0xaba93a80:0x00000001)
  03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err:     at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err:        ... 17 more
03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err: Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xabad5f00: Failure in SSL library, usually a protocol error
03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err: error:1000043e:SSL routines:OPENSSL_internal:TLSV1_ALERT_INAPPROPRIATE_FALLBACK (external/boringssl/src/ssl/s3_pkt.c:610 0xaba93a80:0x00000001)
03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err:     at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
03-03 20:54:52.508 12993-12993/com.mummysocial W/System.err:    ... 17 more
并从

创建了一个HurlStack变量并将其传递给volley.init()方法

我的init方法如下所示:

 public static void init(Context context, HurlStack hurlStack) {

    if(mRequestQueue==null) {
        mRequestQueue = Volley.newRequestQueue(context,hurlStack);
    }
}

我使用firefox下载了证书。在firefox中提到:该证书已经过ssl客户端认证和ssl服务器认证的验证,并且在
getSSLSOcketFactory()
method am passing
SSLContext.getInstance(“TLS”)中进行了验证
请注意,您的
主机名验证程序
可能会阻止您的应用程序在Play Store或其他地方发布。在Android 7.0+上,您可以通过设置自签名证书。@Commonware我遵循了该链接(网络安全配置),仍然是同一个问题。@Commonware检查编辑的问题,我编辑了导致异常的原因:通常这意味着双方无法就TLS版本和加密协议达成一致。我如何让他们达成一致?解决方案是什么?请注意,您的
HostnameVerifier
可能会阻止您的应用程序在Play Store或其他地方发布。在Android 7.0+上,您可以通过设置自签名证书。@Commonware我遵循了该链接(网络安全配置),仍然是同一个问题。@Commonware检查编辑的问题,我编辑了导致异常的原因:通常这意味着双方无法就TLS版本和加密协议达成一致。我如何让他们达成一致?解决办法是什么?
hurlStack = new HurlStack() {
        @Override
        protected HttpURLConnection createConnection(URL url) throws IOException {
            HttpsURLConnection httpsURLConnection = (HttpsURLConnection) super.createConnection(url);
            try {
                httpsURLConnection.setSSLSocketFactory(getSSLSocketFactory());
                httpsURLConnection.setHostnameVerifier(getHostnameVerifier());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return httpsURLConnection;
        }
    };
    MyVolley.init(this,hurlStack);
 public static void init(Context context, HurlStack hurlStack) {

    if(mRequestQueue==null) {
        mRequestQueue = Volley.newRequestQueue(context,hurlStack);
    }
}