-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
More HTTPS #27344
Comments
Thanks for contacting us. |
Going to mark this as a duplicate of #4712 |
I think that issue only covers point 3 |
Relevant comment pointing to a script that creates a cert, trusts it for Chrome, .NET Server->Server, SDK, etc. on Ubuntu #7246 (comment) |
@DamianEdwards I got this to work on Ubuntu 20.04 in all browsers (FF, Chrome, Edge) and between dotnet instances with a recent openssl version. Install the latest letter version of openssl 1.1.1 (K for example) when you are done openssl version should produce 1.1.1K or bigger. Export the certificate and update the certificate store sudo dotnet dev-certs https -ep /usr/local/share/ca-certificates/aspnet/aspnetcore.crt --format PEM
sudo update-ca-certificates Trust the certificate in edge/chromium like browsers
Trust the certificate in firefox {
"policies": {
"Certificates": {
"Install": [
"/usr/share/ca-certificates/aspnet/aspnetcore-https.crt"
]
}
}
} The image above shows the browsers visiting an API endpoint that queries another API with HttpClient for the data and the results are displayed in the three browsers |
@javiercn I went through the instructions you posted, here is what I hit. Using Ubuntu 18.04 LTS VM without a browser (using wget to verify for now). I updated openssl to 1.1.1k. This took around 20 minutes total. Automating this could be useful for users, but updating openssl in general can be a security concern. I needed Running Finally, running I ran wget against the running server and I still get an error:
Not sure if the instructions are supposed to handle |
@jkotalik thanks for taking this for a spin!
The next ubuntu LTS due in a couple of weeks already has a recent enough version.
Good point here, these need to run with sudo. When the screen is presented you need to make sure to select the aspnet/aspnetcore-https certificate (all of them should already be marked).
Do you have Chrome installed on the machine? If not, that's likely the issue. is there a folder in Thanks for trying it out! |
@jkotalik I ended up verifying from a clean ubuntu installation. The steps work, I think |
If you create two APIs, and change the weatherforecast controller in one to return data from the other one via
and then run them with and run |
@javiercn Do you have any idea what to do at the last step you mentioned: "Trust the certificate in firefox" when all the steps were done on WSL2 Ubuntu 20.04 but Firefox is installed on Windows? |
@daniellwdb follow the guidance here |
@javiercn Thank you, I successfully created the {
"policies": {
"Certificates": {
"Install": [
"\\wsl$\\Ubuntu-20.04\\usr\\share\\ca-certificates\\aspnet\\aspnetcore-https.crt"
]
}
}
} Seems like Firefox can't pick it up like this (same with / to separate paths) |
@daniellwdb for wsl I would follow the following steps
If you do the last step firefox should trust your dev certificate provided you trusted it on windows. With steps 2 and 3 you make sure wsl uses the same cert as your windows machine |
@javiercn Thank you, this is a nice issue for reference, following all steps + WSL2 steps above I still end up with ❯ dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
Determining projects to restore...
Writing /tmp/tmpqsnDnO.tmp
info : Adding PackageReference for package 'Microsoft.VisualStudio.Web.CodeGeneration.Design' into project '/home/daniell/TodoApi/TodoApi.csproj'.
error: Unable to load the service index for source https://api.nuget.org/v3/index.json.
error: The SSL connection could not be established, see inner exception.
error: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot Just trying to work my way through the web API tutorial on WSL. Please let me know if this is out of the scope of this issue, HTTPS on Firefox is working fine at https://localhost:5001 |
@daniellwdb What |
5.0.202 |
@daniellwdb It might be that you are running into NuGet/Announcements#49 |
There's a better way to do this
|
I'm closing this issue as done now since we have docs issues filed up waiting to be worked on and the bit about letsencrypt is covered by #4712 dotnet/AspNetCore.Docs#22019 |
The text was updated successfully, but these errors were encountered: