我把代码上传到github上他的协议是https的,但是我页面中有发ajax请求http的这种,被浏览器block了,发的请求又是别人提供的接口,我没有权限修改任何东西,怎么办?
phpcn_u15822017-05-19 10:12:50
从https发送http请求是不可以的,除非对方提供了https的接口。
http://stackoverflow.com/ques...
http://stackoverflow.com/ques...
迷茫2017-05-19 10:12:50
由于Chrome安全限制,非认证证书,当做不安全处理。所以需要为Chrome添加启动参数--ignore-certificate-errors
,来跳过安全检查。在win下这件事很简单,只需要右键->属性在快捷方式后面添加,mac下则略嫌麻烦。
cd /Applications/Google Chrome.app/Contents/MacOS/ # 进入Chrome.app目录
sudo mv Google\ Chrome Google.real # 备份/重命名原启动脚本
sudo printf '#!/bin/bash\ncd "/Applications/Google Chrome.app/Contents/MacOS"\n"/Applications/Google Chrome.app/Contents/MacOS/Google.real" --ignore-certificate-errors "$@"\n' > Google\ Chrome # 使用管道操作创建新的启动脚本,加入所需启动参数
sudo chmod u+x Google\ Chrome # 给新的脚本增加运行权限。
此时重启Chrome,已经可以绕过安全检查,支持当前非官方证书下地址访问了。