-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There was an error trusting HTTPS developer certificate. #21173
Comments
@jozefizso thanks for contacting us. I would suggest you check the certificates in your local store and remove any Also check the trusted roots for the current user for the same. |
I remove the localhost certificates from User and Computer certificate stores and I ran the command again from the admin PowerShell. It still fails.
|
@jozefizso are you able to manually install certificates into your current user store and your trusted roots? Are you in an domain joined machine where some IT policy might be preventing you from adding certificates? |
This is a fresh Windows 10 machine with a newly installed Visual Studio. It is not joined into domain. Well, I'm administrator so I expect I can install certificates. |
@jozefizso hmm, that's the first time we see something like this. Does running |
It says A valid HTTPS certificate is already present. and I have a certificate issued to localhost with friendly name ASP.NET Core HTTPS development certificate Yet when I run the project from Visual Studio (16.5.4) I'm asked to trust the certificate and it ends with error and the project does not run. |
@jozefizso thanks for the details. It seems that you don't have permissions on that machine to add the certificate to the personal user trusted root certificate authorities. I'm not sure why that is, but it clearly seems to be the issue at play here. Not sure why this is happening on your machine, but you would need to get that fixed, as there's nothing we can do in this regard. |
I can delete the certificate and when I run the |
PS C:\WINDOWS\system32> New-SelfSignedCertificate -DnsName xxx -Subject xxx
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\MY
Thumbprint Subject
---------- -------
A9E464C104F658D978FF70C20AB41C80767383E5 CN=xxx |
@jozefizso Yes, but you are dding it to the personal store, not the trusted root certification authorities. Try to copy the certificate there and it will either fail (in which case that's why the tool can't add it) or succeed, in which case your problem will be solved. (Although for some reason the account running VS or something similar doesn't have permission to do so) |
@jozefizso then the issue here is with the account under which both, the tool and VS are running. That's not something we can do anything about. That said, you should be unblocked now. |
This is the same account. When I can make it manually, why Visual Studio nor dotnet tools cannot do it? |
@jozefizso I have no answer for that, it's not something that I've ever seen before. |
Well, thanks, I have only paid 2000 EUR for the license of Visual Studio and it cannot even run simple website. |
I had a similar issue with my private computer (no domain) and solved it with the solution from here: I also removed all previous added ASP certificates in Personal.
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.
Maybe this will help you also. |
Thanks for sharing your resolution here, @hutstep |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
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.The text was updated successfully, but these errors were encountered: