1

I'm trying to make a Progresive Web App, with wamp server, but I need an environment that closely mimic production environment. So I'm using a virtual host to mimic a real domain, and using a self signed certificates to use an HTTPS.

The Problem is self signed certificates is not trusted by the browser, and makes my Service worker failed to register.

I've tried the solution from this thread Can you use a service worker with a self-signed certificate?, by creating a new shortcut on my desktop with the targets

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://myvirtualhostname.com

But that doesn't solve the problem. Please anybody could help on this matter??

Frumentius
  • 349
  • 2
  • 16
  • You should not need the `--unsafely-treat-insecure-origin-as-secure` flag, since that applies to insecure HTTP origins – TmKVU May 02 '19 at 11:28
  • after I remove that flag, and run the chrome, it says "You are using ana usupported command-line flag: --ignore-certificate-errors. Stability and security will suffer." But now with only that flag my service worker is successfully registered and activated. So I think this will do for me. Thank You @TmKVU – Frumentius May 06 '19 at 05:12
  • that warning is normal, it will still work. I will post my comment as an answer so you can accept it and this question can be answered. – TmKVU May 06 '19 at 07:37

1 Answers1

2

You should not need the --unsafely-treat-insecure-origin-as-secure flag, since that applies to insecure HTTP origins.

The --ignore-certificate-errors flag will give a warning on Chrome, but you can ignore this, it will work.

TmKVU
  • 2,910
  • 2
  • 16
  • 30