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.
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.
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:
Just in case, delete any certs that currently exist. Open a terminal and run:
dotnet dev-certs https --clean
-
Download the
tar.gz
file of the "main" release from the .NET SDK package table. You can also access the links directly below. Unpack the downloaded file.
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
Navigate to the unpacked folder:
cd dotnet-sdk-9.0.100-rc.2.24473.22-osx-arm64
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 (12)
@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!!
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.
thank you so muchhhhhhhhhhhhh
Thanks God!!!! You`re my god
Thanks for this! Worked like a charm
awesome cheered me up on my weekend thank you very much
Just ran into this...thank you!
Got here from stackoverflow.com/a/79058879
It works like a charm..! Thank you so much
Thank you so much!! You're a legend!
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
new macbook me too lol thought i was going nuts
It helped a lot, thank!