create-dotnet-devcert icon indicating copy to clipboard operation
create-dotnet-devcert copied to clipboard

Requires dotnet 5.

Open megafluffles opened this issue 4 years ago • 10 comments

Hi, I think this just needs to be added to the prerequisites. Version 3.1 of dotnet dev-certs https doesn't support the --import option as best I can tell.

megafluffles avatar Feb 22 '21 00:02 megafluffles

Correct, I ran into that as well. If someone does not know that, they are puzzled. Better to mention it.

sarvasana avatar Feb 22 '21 08:02 sarvasana

Stuck on this as well. Maybe is there a workaround for dotnet 3.1?

hugofdsantos avatar Mar 27 '21 02:03 hugofdsantos

Stuck on this as well. Maybe is there a workaround for dotnet 3.1?

Install net5, use net31.

sarvasana avatar Mar 28 '21 06:03 sarvasana

Well, I felt like an idiot now 😆. Thank you.

hugofdsantos avatar Mar 28 '21 16:03 hugofdsantos

Wow, I just installed a new machine (manjaro) and am having issues with running dotnet dev-certs https.

Got net5 installed. Could not find the dotnet tool. Ran dotnet tool install --global dotnet-dev-certs Now dotnet dev-certs https does not support the --import argument.

What is going on?

EDIT: Ok, so apparently dotnet-dev-certs comes with net5, so there is no need to install it from nuget. I forgot about that. Installing from nuget will give you a really old version from 2018. Do not do that!

Either I am missing some environment variable or path on my PATH variable or the net5 packages in the arch repositories are broken. When I install those, dotnet-dev-certs cannot be found.

When I install dotnet using ./dotnet-install.sh -c Current the dotnet-dev-certs global tool can be found. https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script

sarvasana avatar Apr 01 '21 15:04 sarvasana

I ran into more problems when using the dotnet-install.sh script. Problems I had were:

  • MSBuild.Sdk.SqlProj could not find dotnet
  • Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37, 5): Metadata generation failed. Exit code: '134' Error: 'No usable version of the libssl was found'

This was most likely caused because dotnet got installed at ~/.dotnet.

The solution that does work is: curl -sSL https://dot.net/v1/dotnet-install.sh | sudo bash /dev/stdin -c LTS --install-dir /usr/share/dotnet curl -sSL https://dot.net/v1/dotnet-install.sh | sudo bash /dev/stdin -c Current --install-dir /usr/share/dotnet sudo ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet

Related regression: 5.0.4 is missing DotnetTools https://github.com/dotnet/source-build/issues/2109

sarvasana avatar Apr 02 '21 09:04 sarvasana

Hello, I'm using Ubuntu and I installed the certificate following the pre requisites. Still when trying to run an asp.net core 5.0 application the browser says it is not secure. In Rider it doesn't even open the browser and it stop the program. In VS Code it starts listening on https://localhost:5001 but it doesn't open any browser as well. Entering the URL directly on the browser shows the not secure warning. Am I missing something? Thanks!

abrahamlaria avatar May 05 '21 06:05 abrahamlaria

In the browser you can simply trust the certificate by using the rendered warning page.

The other issues are probably caused by incorrect launchsettings. I would check those.

sarvasana avatar May 05 '21 09:05 sarvasana

Thanks, I got it to work :)

abrahamlaria avatar May 05 '21 16:05 abrahamlaria

Good point. Yes, dotnet dev-certs https --import needs .NET 5. I will update the README and add this to the prerequisites.

While it is technically possible to add the cert to .NET Core 3.1 SDK, I am not a bash specialist and don't know how to check and add this.

If someone is willing to this contact me and we can discuss this.

BorisWilhelms avatar Jun 27 '21 13:06 BorisWilhelms