I’m developing a progressive webapp and, in order to make sure it’s working on mobile device (and particularly on Chrome for Android as it’s 90% of users), I’m trying to test service worker on an Android device.
Unfortunaltely, on Chrome for Android, I’m unable to register the service worker :
An SSL certificate error occurred when fetching the script.
Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID
I know service worker needs to be served over HTTPS so I have a self-signed certificate for my webapp. It is not trusted by browsers but it is still possible to proceed anyway. When using Firefox for Android, no problem I can sign to push notifications and register the service worker but with Chrome it’s not working.
On Chrome for desktop, it’s possible to enable service worker over non-secure origin with dev tools. I hoped to find the equivalent flag that I could use on mobile but none exists.
Is there a way to authorize service worker on Chrome Android for debug purpose?
I found an old question with no helpful answer there about the same issue and decided to open this one up for visibilty.