我在测试https webserver,在尝试用安卓手机访问时出现了问题。
进行的步骤。
使用这个脚本 让Chrome浏览器接受自签的本地主机证书我为我的服务器生成了证书和密钥,以便通过IP访问它。192.168.0.101
(在脚本中用IP替换了DNS alt_name)。
Ran golang (也试过nodejs) webserver with followed certkey pair:http.ListenAndServeTLS("192.168.0.101:8443", "/home/username/ssl/192.168.0.101.crt", "/home/username/ssl/192.168.0.101.key", router)
添加 myCA.pem
作为桌面谷歌浏览器中的可信权威,它的工作。
增加了相同的 myCA.pem
作为android cert存储中的可信权限,尝试重启chromedevice,但还是无效。
感觉我做了一些错误的服务器证书(但错误指的是CA)和或CA,我不知道为什么它在PC上工作。
我已经重新创建了所有的证书,按照设置。
CN=localhost
[alt_names]
IP.1=127.0.0.1
IP.2=192.168.0.101
IP.3=<external_ip_here_to_check_from_the_web>
它的工作原理在两个平台上的罚款。