skip to Main Content

I am running an angular app using ng serve --port 5001 --ssl --no-live-reload

This worked for a few months but recently Firefox won’t load the page. The error says:

An error occurred during a connection to localhost:5001. Certificate key usage inadequate for attempted operation.

Error code: SEC_ERROR_INADEQUATE_KEY_USAGE

This seems to be a Firefox specific issue. Chrome can connect without issue.

I think it’s also worth noting that this project is usually a .NET project that runs an angular app and I can still connect with it when running via Visual Studio.

I have tried:

  • Removing the "cert9.db" and "cert_override.txt" files from the profile directory.
  • Enabling "ImportEnterpriseRoots" in about:config.
  • Removing "/node_modules/webpack-dev-server/ssl/server.pem" from the project directory.

That same error from above is stilling being shown when I visit the page.

2

Answers


  1. Chosen as BEST ANSWER

    I was able to get it working. Here is what worked for me.

    The issue as I understand it:

    When my certificate expired in late November of this year dotnet generated a new certificate for the project and started using that but it did not immediately delete the old certificate. Firefox then had two certificates with the same issuer and subject and since they both were self signed it didn't know which to pick and just threw an error.

    The solution:

    I deleted the old certificate from Windows certmgr then I removed the certificate from Firefox Certificate Manager. Important: If you reopen the certificate manager before restarting Firefox the certificate comes back. You must delete the certificate from the certificate manager and then restart Firefox.

    Firefox is aware of this issue and is taking steps to make the error message clearer at least: Bug 1611381

    I also found this bug about the certificate manager. Given how old it is I don't have high hopes that this will be changed anytime soon: Bug 454782

    I hope this helps.


  2. I was getting the exact same issue. My React app was seeing this

    SEC_ERROR_INADEQUATE_KEY_USAGE

    I attempted everything that you mention in the question, nothing helped. Then, I installed the Beta Release of Firefox 121.0b8, it solved the issue for me. At this point not sure if they addressed the issue as I did not see any mention of that in release note, but this version solves the problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search