Polymer 为什么SimpleHTTP2Server无法在本地主机上加载服务工作进程
当我尝试使用端口5000在本地主机上运行本地绑定和非绑定版本时,对service-worker.js的请求失败:Polymer 为什么SimpleHTTP2Server无法在本地主机上加载服务工作进程,polymer,polymer-1.0,http2,Polymer,Polymer 1.0,Http2,当我尝试使用端口5000在本地主机上运行本地绑定和非绑定版本时,对service-worker.js的请求失败: An SSL certificate error occurred when fetching the script. https://localhost:5000/service-worker.js Failed to load resource: net::ERR_INSECURE_RESPONSE (index):1 Uncaught (in promise) DOMExcep
An SSL certificate error occurred when fetching the script.
https://localhost:5000/service-worker.js Failed to load resource: net::ERR_INSECURE_RESPONSE
(index):1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script.
有没有一个简单的方法让它工作?我尝试了许多启动标志,如:
chrome.exe --ignore-certificate-errors --incognito
--unsafely-treat-insecure-origin-as-secure --allow-insecure-localhost
但这没有帮助,我仍然得到:
(index):1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script.
根据alesc的建议,我找到了说明: 以下是Windows 10上Chrome 55的说明。看来这些步骤可能会经常改变
服务工作人员仅使用受信任的SSL证书。您可以将您的自签名证书添加到受信任证书列表中,以绕过此操作(这显然只适用于您)。谢谢,alesc,这很有效。