HTML5 缓存清单可通过 http 运行,但不能通过 https 运行
我的 google-fu 今天似乎不符合要求,所以就这样...
我有一个 django 应用程序,使用 wsgi 位于 apache 之上。我正在尝试使这项工作离线。我从 django url 提供具有正确 mimetype 和无缓存标头的缓存清单文件。我在模板中有一个清单引用,看起来像
<html lang="en" manifest="/myPath/manifest/">
为了调试这个问题,我首先使用最简单的清单文件
缓存清单
网络:
*
但是,当我尝试通过 https 提供服务时,这会在 chrome 中出现以下错误界面。
创建应用程序缓存 显现 https://127.0.0.1/myPath/manifest/ 应用程序缓存检查事件 应用程序缓存错误事件: 清单获取失败 (-1) https://127.0.0.1/myPath/manifest/
当通过 http 提供服务时,它似乎工作正常。我在我的开发计算机上使用自签名安全证书。这是我认为唯一可能导致服务相同清单文件的 http 和 https 之间存在差异的事情(使用相对链接,因此来源是正确的)。是什么导致了 http 和 https 之间的差异,以及如何纠正它?
My google-fu does not seem up to snuff today so here it goes...
I have a django application sitting on top of apache using wsgi. I am attempting to make this work offline. I serve the Cache Manifest file from a django url with the correct mimetype and a no-cache header. I have a manifest reference in the template that looks like
<html lang="en" manifest="/myPath/manifest/">
In order to debug this problem I am using the simplest of manifest files first
CACHE MANIFEST
NETWORK:
*
However, this gives me the following errors in chrome when I attempt to serve it via the https interface.
Creating Application Cache with
manifest
https://127.0.0.1/myPath/manifest/
Application Cache Checking event
Application Cache Error event:
Manifest fetch failed (-1)
https://127.0.0.1/myPath/manifest/
When served over http it appears to work correctly. I am using a self signed security certificate on my development machine. This is the only thing that I can think might make the difference between http and https serving the same manifest file(using relative links so the origin is correct). What is causing the difference between http and https, and how to I correct it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会责怪你的自签名证书。
如果那些看起来吓人的警告对话框还不够,Chrome 和 Firefox 对自签名证书的态度相当恶劣。例如,HSTS 不适用于任一浏览器中的自签名证书。
I'd blame your self-signed certificate.
Chrome and Firefox, if the scary-looking warning dialogs weren't enough, are quite anal about self-signed certificates. For example, HSTS does not work with self-signed certificates in either browser.