-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Updating dotnet dev-certs https
to better support expanded scenarios
#60369
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
Comments
dotnet dev-certs https
to better support non-ASP.NET Core scenarios
dotnet dev-certs https
to better support non-ASP.NET Core scenariosdotnet dev-certs https
to better support expanded scenarios
The code in question is currently shared between My preference for the Aspire scenario (dotnet/aspire#7756) is that we rely on the command line tool, rather than try introduce another party this code needs to be shared/synced with. Orchestrating external tools is very much what Aspire does already for lots of things and I think it's simpler approach in this case (but I'm willing to be convinced otherwise). That said, to better support this model, I think RE the subject alternative names, we simply need the two known container host network hostnames ( The Also, the Aspire scenario we want to enable with these changes needs to work for the .NET 8 or .NET 9 SDKs too (as Aspire supports those versions) so these changes need to backported to 8.0.1xx and 9.0.1xx so they're available everywhere. |
As Damian says, the dev-certs tool is limited to a limited range of certificates on purpose, due to security concerns If you want to start issuing trusted certificates for old host then I suggest using OpenSSL to generate a root CA and then issue certificates from that. |
@DamianEdwards Was about to open a new issue, but I think this is the same issue I am experiencing. Maybe it should be re-named to "Allow The default Visual Studio aspnetcore / Angular project has to export the cert to a file, and it's then used by the JavaScript development server. This is more finicky than it should be, and I've seen it break in multiple ways. I also ran into an issue when dealing with something like #50335 where I would have loved to be able to just pipe the exported cert to a different command. |
@EmperorArthur our current plan is to add support for a hidden flag that changes the output of the dev-certs command to JSON for better integration with other tools, but it doesn't include the actual certificate in the export case I believe, just the metadata like thumbprint, result message, etc. Supporting export to std out is a good idea that I'm supportive of but it's not clear when we'd be able to prioritize that at the moment. |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
It would be helpful to be able to retrieve and generate dev certs programmatically.
Currently, we have to use some hacky way to retrieve it programmatically (see https://github.com/dotnet/aspire-samples/pull/667/files).
Another limitation of the current situation is that since the cert is only valid for
localhost
, so if an app is running in a container and needs to access another service on the host, there will be an SSL error since requests will be done againsthttps://host.docker.internal
. Same issue with other container services running with short names, likehttps://catalog
for example.Describe the solution you'd like
Additional context
No response
The text was updated successfully, but these errors were encountered: