android webview with client certificate

前端 未结 8 2071
情歌与酒
情歌与酒 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条回答
  •  盖世英雄少女心
    2020-11-29 04:57

    onReceivedClientCertRequest() is added to WebViewClient since API 21. https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedClientCertRequest(android.webkit.WebView,%20android.webkit.ClientCertRequest)

    The solution from the following Stackoverflow post worked for me: Android WebView handle onReceivedClientCertRequest

    To test:

    • Server URL: https://client.badssl.com/
    • Client certificate: https://badssl.com/download/

    When client certificate is not setup, you will see "400 bad request".

提交回复
热议问题