android webview with client certificate

前端 未结 8 2072
情歌与酒
情歌与酒 2020-11-29 04:16

I tried for days to use a web view with a client certificate embedded in the application, but it seems to me that the android sdk does not provide any way to do it, is there

8条回答
  •  猫巷女王i
    2020-11-29 04:44

    If you just need to ignore ssl certificate requests inside the web view, this worked for me on Lollipop:

    Inside your web view client, overwrite:

    @Override
    public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
        handler.proceed(); // Ignore SSL certificate errors
    }
    

    This is useful for debugging webviews against qa/dev/stage environments.

提交回复
热议问题