javascript - Sending ajax request in https but http is blocked by the browser
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-19 10:10:50
0
2
623

I uploaded the code to github and its protocol is https, but there is an ajax request for http in my page, which is blocked by the browser. The request is an interface provided by others, and I do not have the permission to modify it. Anything, what to do?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
phpcn_u1582

Sending http requests from https is not allowed unless the other party provides an https interface.

  • http://stackoverflow.com/ques...

  • http://stackoverflow.com/ques...

迷茫

Due to Chrome security restrictions, non-authenticated certificates are treated as unsafe. So you need to add startup parameters --ignore-certificate-errors to Chrome to skip the security check. This is very simple under win, just right-click -> Properties and add after the shortcut, but it is a little troublesome under 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    # 给新的脚本增加运行权限。

Restart Chrome at this time, you can already bypass the security check and support access to addresses under the current unofficial certificate.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!