There was an error trusting HTTPS developer certificate.

See original GitHub issue

I have issue with trusting the HTTPS certificate for .NET Core development.

I tried to trust the certificate from Visual Studio and from dotnet dev-certs tool from the administrator PowerShell. Both fail.

dotnet dev-certs https --trust -v
Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate.
Listing 'HTTPS' certificates on 'CurrentUser\My'.
'1' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
CN=localhost - A67EEAF595CD2AE44B9296F21BC03B8847D18C0F - 24. 4. 2020 14:51:37 - 24. 4. 2021 14:51:37 - True
Checking certificates for validity.
Listing valid certificates
'1' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
CN=localhost - A67EEAF595CD2AE44B9296F21BC03B8847D18C0F - 24. 4. 2020 14:51:37 - 24. 4. 2021 14:51:37 - True
Listing invalid certificates
'0' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
Listing 'HTTPS' certificates on 'LocalMachine\My'.
'0' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
Checking certificates for validity.
Listing valid certificates
'0' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
Listing invalid certificates
'0' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
Filtering found certificates to those with a subject equal to 'CN=localhost'
'1' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
CN=localhost - A67EEAF595CD2AE44B9296F21BC03B8847D18C0F - 24. 4. 2020 14:51:37 - 24. 4. 2021 14:51:37 - True
Listing certificates excluded from consideration.
'0' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
Found valid certificates present on the machine.
'1' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
CN=localhost - A67EEAF595CD2AE44B9296F21BC03B8847D18C0F - 24. 4. 2020 14:51:37 - 24. 4. 2021 14:51:37 - True
Selected certificate
'1' found matching the criteria.
SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY
CN=localhost - A67EEAF595CD2AE44B9296F21BC03B8847D18C0F - 24. 4. 2020 14:51:37 - 24. 4. 2021 14:51:37 - True
Trying to export the certificate.
Trusting the certificate on Windows.
Adding certificate to the store.
There was an error trusting the certificate.
Exception message: Access is denied.
There was an error trusting HTTPS developer certificate.
dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.103
 Commit:    6f74c4a1dd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19041
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.103\

Host (useful for support):
  Version: 3.1.3
  Commit:  4a9f85e9f8
error01

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
jozefizsocommented, Apr 24, 2020

Well, thanks, I have only paid 2000 EUR for the license of Visual Studio and it cannot even run simple website.

1reaction
hutstepcommented, May 2, 2020

I had a similar issue with my private computer (no domain) and solved it with the solution from here: https://serverfault.com/questions/1008035/unable-to-import-certificate-into-user-trusted-root-certificate-store

I also removed all previous added ASP certificates in Personal.

dotnet dev-certs https --clean

After setting the group policy and restarting my computer I could add the dev certificate with dotnet dev-certs to the Trusted Root Certification Authorities. Now starting the project in Visual Studio is working without any issues.

dotnet dev-certs https --trust

Maybe this will help you also.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble trusting local HTTPs certificate in ASP.NET Core
It should show me a prompt to trust the certificate but it says "there was an error trusting the HTTPS developer certificate" and...
Read more >
Failed to trust HTTPS certificate
Cleaning HTTPS development certificates from the machine. This operation might require elevated privileges. If that is the case, a prompt for ...
Read more >
Installed ASP.NET Core Dev Certificates but still "Unable to ...
# The HTTPS developer certificate was generated successfully. But sometimes, like my case, it won't help, and you'll see this annoying exception ...
Read more >
dotnet dev-certs command - .NET CLI
Generating a certificate for use with HTTPS endpoints during development. Trusting the generated certificate on the local machine.
Read more >
Invalid dev certificate which I can't trust or change?
There was an error trusting the certificate. Exception message: Access is denied. There was an error trusting HTTPS developer certificate.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found