GoogleChromeLabs / simplehttp2server

A simple HTTP/2 server for development
Other
1.74k stars 98 forks source link

Certificate error (version 2.3.1) - How can it be fixed? #13

Closed odili closed 8 years ago

odili commented 8 years ago

I tried running the server(version 2.3.1) but got this error in my console:

Uncaught (in promise) DOMException: Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script.

This obviously didn't allow SW to be registered in my app.

How do I fix this?

surma commented 8 years ago

The only workaround I am aware of is setting chrome://flags/#allow-insecure-localhost.

Sadly, adding a certificate exception doesn’t include the ServiceWorker fetch, so that’s why there’s an error. There is a Chrome bug IIRC, just can’t find it 😕

janbaer commented 7 years ago

This hint wasn't working for me. Chromium will not accept the certificate and that's why the ServiceWorker I wanted to play with wasn't installed...

surma commented 7 years ago

@janbaer Can you try starting Chrome with --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://localhost:5000? I am working with the Chrome team to fix this, but currently it needs a workaround.

janbaer commented 7 years ago

It's wasn't working for me with build 56 of Chromium which I got installed it in Ubuntu with apt-get. After I downloaded manually the nightly build (59) it worked with the command flags you described. Thank you!