问题
I am trying to get client Samsung tablet to work with site requiring client devices to have cert. I can get it working on tablets with 5.0+ because webview has onReceivedClientCertRequest. So I can use that to then load the cert and the key.
But I am having problems on tablets running 4.4.2 because that onReceivedClientCertRequest function is for 5+. When I run on 4.4.2 my concern is that the logger shows:
'12-23 12:46:07.541 20804-20804/com.example.ssltest I/chromium: [INFO:aw_content_browser_client.cc(349)] Client certificate request from rejected. (Client certificates not supported in WebView)'
...is is true that I can't use webview on tablets running<5 if site requires client cert?
If not true, can someone help me on how to do it?
回答1:
You can install user certificates on a 4.4.2 tablet. This would not be the right solution for production code (for production you would usually have a trusted cert anyways), but is good for testing a site which does not have a trusted cert.
To do this:
- Download the cert file to the phone.
- In the Settings go to the security tab. In it under Credential storage find Install from SD card:
- Select the file you downloaded:
- You need to install a PIN/Password if you don't already have one.
来源:https://stackoverflow.com/questions/41306089/android-webview-and-certs-on-4-4-2