DEV Community

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

Posted on

77 3 2 4 3

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.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (15)

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
 
sanbartels profile image
Daniel Santiago

Umbraco <3

Collapse
 
camilahp profile image
Camila HAAS PRIMIERI

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
Collapse
 
nextchanupol profile image
Ouu Naja

thank you so muchhhhhhhhhhhhh

Collapse
 
weekyear profile image
weekyear

Thanks God!!!! You`re my god

Collapse
 
mark_defty_8ce3606e846dad profile image
Mark Defty

awesome cheered me up on my weekend thank you very much

Collapse
 
jimihewett profile image
James Hewett

Thanks for this! Worked like a charm

Collapse
 
joo_miranda_9de9acd8af9e profile image
João Miranda

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

Collapse
 
nhannn profile image
Nhân Nguyễn

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

Collapse
 
mfschweitzer profile image
Mike Schweitzer

Just ran into this...thank you!

Got here from stackoverflow.com/a/79058879

Collapse
 
masoudarvishian profile image
Masoud Darvishian

It helped a lot, thank!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more