MV3 ServiceWorker ERR_SSL_CLIENT_AUTH_CERT_NEEDED

220 views
Skip to first unread message

Joseph Flood

unread,
Oct 23, 2022, 9:21:54 AM10/23/22
to Chromium Extensions
I am upgrading my extension to MV3 and now have a service worker that makes auth calls to an API under https.

On first install these calls work fine. But after some time they will persistently fail with ERR_SSL_CLIENT_AUTH_CERT_NEEDED.

 This seems to be a CORS preflight issue and related to this bug https://bugs.chromium.org/p/chromium/issues/detail?id=775438

The above bug describes how the TLS client certificate is being included in the cors preflight request in chrome.

At the end of that thread it is explained that a new chrome flag has been added to chrome to prevent this issue.

I have switched on that flag, but it does not appear to resolve the issue, calls continue to be rejected.

Is this an issue with the extensions implementation of the ServiceWorker? Perhaps this flag has not been implemented there?

Here's the strange part. If I copy the fetch call that failed from the network tab and paste it into the console of an MV2 extension the call succeeds fine. 

What is even more strange... is when I go back to the MV3 extension with the ServiceWorker, these calls magically start working again.



Joseph Flood

unread,
Oct 23, 2022, 9:50:14 AM10/23/22
to Chromium Extensions, Joseph Flood

Ok, so it looks like I was led astray by the "credentials":"omit" that was in the copied fetch call.

It turns out my code was not actually setting that. If I set "credentials":"omit" in my fetch call then that flag starts working.

Still weird as to why the calls sometimes worked and sometimes didn't. I suspect there must be some kind of caching going on somewhere. 
Reply all
Reply to author
Forward
0 new messages