Eptagone / Vite.AspNetCore

Small library to integrate Vite into ASP.NET projects
MIT License
264 stars 35 forks source link

Chrome dev certificate issue #73

Closed boggye closed 2 months ago

boggye commented 11 months ago

Hi,

I just want to say that yesterday I experienced issues with Chrome, version 119.0.6045.160 (Official Build) (64-bit). The requests to the vite server returned invalid certificate. I regenerated the certificate using the same command as in the vite.config.ts, including the "-t" command option to trust the certificate (which is not in the file). That didn't worked. So, I fixed the error by adding https://localhost:5173 to the list of of "safe" origins in this option: chrome://flags/#unsafely-treat-insecure-origin-as-secure:

image

What was weird was that, before I applied the fix above, even though the https calls were solved when I typed them individually in the address bar (I proceeded to the "unsafe" address when prompted by chrome), the script calls to the same url were failing.

Chrome lately introduced more restrictions that are a pain when one uses IIS and self signed certificates in test environments. More details can be found on this thread: https://support.google.com/chrome/thread/239508594/err-ssl-key-usage-incompatible-error-in-chrome-but-not-edge-for-all-google-sites-and-some-others?hl=en. See also this: https://support.google.com/chrome/thread/239508594?hl=en&msgid=244501308&sjid=9050201840077254564-NC

Based on the information in the threads, I found a workaround. Running this command will disable that ssl certificate flag check: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory=Default --force-fieldtrials=RSAKeyUsageForLocalAnchors/DisabledLaunch

If you have other suggestions or advice, please let me know.

Eptagone commented 8 months ago

Hi, sorry for the delay. Are you using the ASP.NET certificate?

boggye commented 8 months ago

Sorry, it has been a while - I don't recall exactly, as I wrote, I ended up using the workaround I described in the post.