简体   繁体   English

C# 项目在 VS 的 ssl 上运行,但因 docker-compose 问题而失败

[英]A C# project runs on ssl from VS, but fails with docker-compose with ssl problem

What can be the problem?可能是什么问题? This exception is throwned by the console while running with docker (docker-compose).使用 docker (docker-compose) 运行时,控制台会引发此异常。 The VS2022 runs the project perfectly. VS2022 完美运行项目。

Unhandled exception.未处理的异常。 System.InvalidOperationException: Unable to configure HTTPS endpoint. System.InvalidOperationException:无法配置 HTTPS 端点。 No server certificate was specified, and the default developer certificate could not be found or is out of date.未指定服务器证书,默认开发人员证书找不到或已过期。

I have run: dotnet dev-certs https --clean AND dotnet dev-certs https --trust我已经运行: dotnet dev-certs https --clean 和 dotnet dev-certs https --trust

You are not creating the dev certificate.您没有创建开发证书。 You can do that with:你可以这样做:

dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\aspnetapp.pfx -p crypticpassword
dotnet dev-certs https --trust

See here for reference 请参阅此处以供参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM