DEV Community

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

Posted on

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

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.

Top comments (5)

Collapse
 
underflow profile image
Steffen H. Nielsen

@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!!

Collapse
 
michaelcharles profile image
Michael Charles Aubrey

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.

Collapse
 
nextchanupol profile image
Ouu Naja

thank you so muchhhhhhhhhhhhh

Collapse
 
alexis_patentre_73657c17 profile image
Alexis PATENÔTRE

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

Collapse
 
joo_miranda_9de9acd8af9e profile image
João Miranda

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