dotnet / dotnet/AspNetCore.Docs

Real fix for certificate issues under mac

Open
#33,997 0 comments 0 reactions 0 assignees View on GitHub
:watch: Not Triaged aspnet-core/svc security/subsvc Source - Docs.ms
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

### Description

I had quite some issues with the developer certificate on mac. For some reason all removal via tooling or keychain did not solve the issue. I finally found someone that solved it and I think it makes sense to add that to the documentation. The solution is from https://www.reddit.com/r/aspnetcore/comments/10uneql/keep_getting_https_development_certificate_was/ and here is the short version.

1. Launch the Keychain Access Application and remove all certificates that are names localhost under login.
2. Launch the terminal and navigate to following folder and remove any remaining pfx file manually

```
cd ~/.aspnet/dev-certs/https
rm *.pfx
```
(I guess this is the difference and did the trick)

4. Run clean and trust dev-certs command below:

```
dotnet dev-certs https --clean
dotnet dev-certs https -t
```

5. Re-launch the Visual Studio for Mac and run your project with Https (was not necessary for me)

### Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-3.0&tabs=visual-studio%2Clinux-sles#docker---certificate-not-trusted

### Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/enforcing-ssl.md

### Document ID

12ca0b9a-2638-a4ce-c45f-d4579c83dafb

### Article author

@tdykstra

[Related Issues](https://github.com/dotnet/AspNetCore.Docs/issues?q=is%3Aissue+is%3Aopen+12ca0b9a-2638-a4ce-c45f-d4579c83dafb)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.