Skip to content Skip to sidebar Skip to footer

Webview Handshake Failed

I cannot call post request (Https) using webview. In my logcat I find this [1031/175452:ERROR:ssl_client_socket_openssl.cc(905)] handshake failed; returned 0, SSL error code 5, n

Solution 1:

Quick Fix: Ignore SSL certificate error.

WebView webview = findViewById(R.id.webView_about_alc);


    webview.setWebViewClient(newWebViewClient() {

        @OverridepublicvoidonReceivedError(WebView view, int errorCode, String description, String failingUrl) {
            Toast.makeText(AboutAlcActivity.this, description, Toast.LENGTH_SHORT).show();
        }

        @OverridepublicvoidonReceivedSslError(WebView view, SslErrorHandler handler, SslError er) {
            handler.proceed(); // Ignore SSL certificate errors
        }

    });

    webview.loadUrl(ALC_ABOUT_PAGE);

-

Better Answer : Fix the Android Network Security Configuration for your project. Follow the below link on how to do so.

https://developer.android.com/training/articles/security-config

Post a Comment for "Webview Handshake Failed"