TLS 1.1, 1.2 in WebView for android <= 4.3
<p>In my android application I need to display 3rd-party registration form inside <code>WebView</code>. Unfortunately, I need to also support android versions &lt; 4.3, where you get SSL handshake error when you connect to the website. I was, however, able to create direct requests on android 4.1+ with a custom SSL context which has TLS 1.1 explicitly enabled, but I can't pass this SSL context into my <code>WebView</code>. I tried to make custom <code>WebViewClient</code> </p>

<pre><code>    private WebViewClient webViewClient = new WebViewClient() {
    @Override
    public void onPageFinished(WebView webView, String url) {
        if (presenter != null) {
            presenter.onLoadFinished();
        }
    }

    @Override
    public void onReceivedError(WebView webView,
                                WebResourceRequest request,
                                WebResourceError error) {
        if (presenter != null) {
            presenter.onLoadError();
        }
    }

    @Override
    public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error){
        handler.proceed();
    }

    @Override
    public boolean shouldOverrideUrlLoading(WebView webView, String url) {
                Request request = new Request.Builder().url(url).build();
    final Handler handler = new Handler(mContext.getMainLooper());
    //mOkHttpClient is an OkHttpClient with my custom SSLContext which has TLS 1.1 and TLS 1.2 enabled
    mOkHttpClient.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {

            }

            @Override
            public void onResponse(Call call, final okhttp3.Response response) throws IOException {
                handler.post(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            webView.loadDataWithBaseURL(
                                    null, response.body().string(), "text/html", "utf-8", null);
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                });
            }
        });
    }

};
</code></pre>

<p>But that didn't work since <code>shouldOverrideUrlLoading</code> is not called on POST requests. </p>

<p>Is there a way to make this work(probably some alternative to <code>WebView</code>)? Any help is appreciated. </p>