Chrome 是否允许我的扩展程序向自签名服务器证书发送 HTTPS 请求?
希望我的问题已经很清楚了。我正在尝试从 Chrome 扩展程序的后台页面向我拥有的服务器发送 AJAX (HTTPS) 请求。根据我所读到的内容,如果不修改我自己的浏览器设置,我无法将 AJAX 请求发送到未签名/自签名的服务器,但我想知道 Chrome 扩展程序是否具有不同的权限。 (我也无法让所有用户更改他们的浏览器设置以使我的应用程序为他们工作。)
从我自己的扩展中看到的,我的后台页面发送的所有 HTTPS 请求都是“已取消”(通过查看开发控制台)。
除了获取签名证书或做一些像模拟 HTTP 安全连接这样的黑客行为之外,还有其他方法可以解决这个问题吗?
Hopefully my question has been pretty clear. I'm trying to get send AJAX (HTTPS) requests to a server that I own from the background page of my Chrome extension. From what I've read, I can't send AJAX requests to an unsigned/self-signed server without tinkering with my own browser settings, but I was wondering if Chrome extensions have different privileges. (I also cannot afford to have all of my users change their browser settings to get my app to work for them.)
From what I've seen of my own extension, all of the HTTPS requests that my background page have sent have been 'canceled' (from viewing the dev console).
Is there a way around this, besides getting a signed cert or doing something hacky like emulating a secure connection with HTTP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
测试此功能的最简单方法是将权限部分添加到您的扩展清单中,其中包含您也发出请求的服务器的 URL。所以它可能看起来有点像:
{
“名称”:“测试”,
“版本:”1”,
“权限”:[“https://domainofselfsignedcert”]
不是
如果这不起作用,下一个选项是查看实验设置 API (http://code.google.com/chrome/extensions/trunk/experimental.settings.html) 不幸的是,这 尚未完全可用,但可能使您能够在没有证书的情况下允许访问您的域。
The easiest way to test this is to add a permissions section to your extensions manifest with the url of the server you are making the request too. So it might look a little something like:
{
"name": "test",
"version: "1",
"permissions": [ "https://domainofselfsignedcert" ]
}
If this doesn't work, the next option is to look at the experimental settings API (http://code.google.com/chrome/extensions/trunk/experimental.settings.html) unfortunately this is not yet fully available, but might give you the ability to allow access to your domain without a cert.