1

When I try to run the Polymer Shop locally, both the bundled and unbundled builds, using the SimpleHTTP2Server , on my local host using port 5000, the request for service-worker.js fails:

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.

Is there an easy way to get this to work? I tried a number of start up flags, like:

chrome.exe --ignore-certificate-errors --incognito
--unsafely-treat-insecure-origin-as-secure --allow-insecure-localhost

but that didn't help, I still get:

(index):1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script.
Bruce
  • 152
  • 3
  • 11
  • 1
    Service workers only work with trusted SSL certificates. You can add your self-signed certificate to the list of trusted certificates in order to bypass that (which will obviously work only for you). – alesc Jan 14 '17 at 19:45
  • Thanks, alesc, that worked. – Bruce Jan 15 '17 at 13:28

1 Answers1

2

Following alesc's suggestion, I found instructions here:

These are instructions for Chrome 55 on Windows 10. It seems these steps may change frequently.

  1. On the page with the untrusted certificate (https:// is crossed out in red), click the lock so a popup opens up.
  2. Click the Details link under the information section at the top.
  3. Click on the View Certificate button.
  4. Click on the Details tab
  5. Click on the Copy to File
  6. Click Next
  7. Export as PKCS #7
  8. Open up Chrome Settings > Show advanced settings > HTTPS/SSL > Manage Certificates
  9. Import the certificate created in step 7 to both the Intermediate Certificate Authorities tab as well as the Trusted Authorities Tab.
  10. Restart Chrome and open your localhost site.
Community
  • 1
  • 1
Bruce
  • 152
  • 3
  • 11