Fixing the HTTPS Developer Certificate Error in .NET on macOS Sequoia
Michael Charles Aubrey

Michael Charles Aubrey @michaelcharles

About: Senior Software Engineer at Maki / Born in Florida, lives in Akita / フロリダ州🏝で生まれた 秋田在住👹 ✨へばナイスデイ✨

Location:
Akita City, Akita Prefecture, Japan
Joined:
Dec 9, 2019

Fixing the HTTPS Developer Certificate Error in .NET on macOS Sequoia

Publish Date: Sep 24 '24
94 17

MacOS 15 Sequoia has introduced changes to its security APIs which has broken the dotnet CLI's ability to generate and trust HTTPS developer certificates.

The command dotnet dev-certs https fails with the message:

There was an error creating the HTTPS developer certificate.
Enter fullscreen mode Exit fullscreen mode

When run with the verbose flag (-v), you'll see a more detailed error:

An error has occurred generating the certificate: Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The specified item is no longer valid. It may have been deleted from the keychain.
Enter fullscreen mode Exit fullscreen mode

Impact

This issue is blocking .NET developers on macOS Sequoia from generating or trusting HTTPS development certificates. Without these certificates, you can't develop and debug .NET applications that require HTTPS.

Workaround

While a fix is planned for release in October, here's a workaround (thanks to users pvasek and kalebzettl on GitHub) that you can use right now:

  1. Just in case, delete any certs that currently exist. Open a terminal and run: dotnet dev-certs https --clean

  2. Download the tar.gz file of the "main" release from the .NET SDK package table. You can also access the links directly below.

  3. Unpack the downloaded file.

  4. Remove the quarantine attribute from the unpacked folder. From your terminal run: xattr -d com.apple.quarantine -r <folderName> Replace <folderName> with the name of your unpacked folder. For example: xattr -d com.apple.quarantine -r dotnet-sdk-9.0.100-rc.2.24473.22-osx-arm64

  5. Navigate to the unpacked folder: cd dotnet-sdk-9.0.100-rc.2.24473.22-osx-arm64

  6. From within this folder, run the following to generate and trust the certificate. ./dotnet dev-certs https --trust

Note the ./ before dotnet – this ensures you're using the version you just downloaded, not the globally installed one.

This should successfully generate and trust the HTTPS developer certificate, allowing you to continue your .NET development on macOS Sequoia.

Comments 17 total

  • Steffen H. Nielsen
    Steffen H. NielsenSep 24, 2024

    @michaelcharles thank you so much for this guide. I was having the trouble trying to get Umbraco to work on my M1 Macbook air with the new mac os update. I have looked for hours and hours trying to find a solution, and was at the point of giving up for tonight, but then i stumpled upon your post :D

    I followed your guide and now everything works. I have my dev-cert ready for use and i can now actually start my projects :D

    I would give you 1.000.000 likes and start if i could. Thank you sooooo much!!

    • Michael Charles Aubrey
      Michael Charles AubreySep 25, 2024

      Thanks, I'm glad!

      I had a very similar experience and finally found a workaround posted in the GitHub issue, so I made this article/guide to give the workaround more visibility since (like you) I had trouble finding information about it online. I hope this can help people.

    • Daniel Santiago
      Daniel SantiagoJan 23, 2025

      Umbraco <3

  • João Miranda
    João MirandaSep 25, 2024

    Thank you so much!! You're a legend!

  • Ouu Naja
    Ouu NajaSep 26, 2024

    thank you so muchhhhhhhhhhhhh

  • Alexis PATENÔTRE
    Alexis PATENÔTRESep 27, 2024

    Thank you SO MUCH, three system restores after receiving my new MacBook, I was tripped up with these certificate errors, being the only one on my team to encounter this problem... THANK YOU again

    • Mark Defty
      Mark DeftySep 28, 2024

      new macbook me too lol thought i was going nuts

  • Mark Defty
    Mark DeftySep 28, 2024

    awesome cheered me up on my weekend thank you very much

  • Masoud Darvishian
    Masoud DarvishianOct 1, 2024

    It helped a lot, thank!

  • Mike Schweitzer
    Mike SchweitzerOct 8, 2024

    Just ran into this...thank you!

    Got here from stackoverflow.com/a/79058879

  • Nhân Nguyễn
    Nhân NguyễnOct 8, 2024

    It works like a charm..! Thank you so much

  • James Hewett
    James HewettOct 9, 2024

    Thanks for this! Worked like a charm

  • weekyear
    weekyearNov 1, 2024

    Thanks God!!!! You`re my god

  • Camila HAAS PRIMIERI
    Camila HAAS PRIMIERINov 28, 2024

    Thank you so much for this guide!
    Unfortunately, I needed an extra step to make it work with my current project:

    1. Go to cd ~/.aspnet/https
    2. Remove all .key and .pem files related to the project
    3. Build the solution again
  • Giang Phan
    Giang PhanFeb 19, 2025

    Thank you very much for the solution. How did you figure this out?

  • Victor Chigozie Nwafor
    Victor Chigozie NwaforMar 10, 2025

    Awesome, the solution worked.

  • Amjad Hani
    Amjad HaniApr 29, 2025

    This was very helpful. Thank you very much

Add comment