4.4.2上的Android Webview和证书 [英] Android webview and certs on 4.4.2

查看:138
本文介绍了4.4.2上的Android Webview和证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使客户端三星平板电脑与要求客户端设备具有证书的网站一起使用。我可以在5.0及更高版本的平板电脑上使用它,因为Webview具有onReceivedClientCertRequest。因此,我可以使用它来加载证书和密钥。

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.

但是我在运行4.4.2的平板电脑上遇到问题,因为onReceivedClientCertRequest函数适用于5+版本。当我在4.4.2上运行时,我担心的是记录器会显示:

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)]客户端证书请求
被拒绝。 (
WebView不支持客户端证书)'

'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)'

...是的,我不能在平板电脑是否运行< 5(如果网站需要客户端证书)?

...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?

推荐答案

您可以在4.4.2平板电脑上安装用户证书。对于生产代码而言,这不是正确的解决方案(对于生产而言,无论如何,您通常都会拥有受信任的证书),但是对于测试没有受信任的证书的站点而言,它是很好的选择。

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.

要执行以下操作:


  1. 将证书文件下载到手机中。

  2. 在设置进入安全选项卡。在凭据存储下的其中,找到从SD卡安装

  1. Download the cert file to the phone.
  2. In the Settings go to the security tab. In it under Credential storage find Install from SD card:


  1. 选择您下载的文件:


  1. 如果您还没有PIN /密码,则需要安装。

这篇关于4.4.2上的Android Webview和证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆