Asp.Net Core中的SSL不起作用 [英] SSL in Asp.Net Core doesn't work
问题描述
我从Visual Studio Web Application(Net.Core)
模板创建了一个简单的Web应用程序,并获得了单独的用户帐户授权.
然后,我在 Project-> MyProject属性...
中启用了SSL,并将带有https的URL复制到App Url.
最后,我添加了:
services.AddMvc(options =>{options.Filters.Add(new RequireHttpsAttribute());});
到启动
.
它不起作用!当我启动应用程序时,它只是在一秒钟后关闭,什么也没有发生,没有错误,什么都没有!
Asp.Net Core中的SSL有什么问题,如何正确启用它?
对于开发测试,您需要首先启用SSL.
右键单击项目>属性">调试"
- 在配置文件中选择"IIS Express"
- 选中启用SSL"
如果调试在启动后停止(未找到进程ID),则必须将IIS Express自签名证书安装到证书存储中.
您可以遵循本指南 现在,您应该可以对其进行调试了. I created a simple web application from visual studio Then, I enabled SSL in Finally, I added: to And it doesn't work! When I'm starting the application, it just simply turns off after a second, and nothing happens, no error, nothing! What's wrong with SSL in Asp.Net Core, and how can I enable it correctly? For development testing you need to enable SSL first. Right click the project > Properties > Debug If your debugging stops after starting (no process ID found), then you have to install the IIS Express self-signed certificate into the certificate store. You can follow this guide here. It's bit older but still applies to Visual Studio 2015. It's due to a bug in Update 3 where IIS Certificate isn't installed in the trusted certificate storage correctly. Alternatively, Now you should be able to debug it. 这篇关于Asp.Net Core中的SSL不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!Web Application(Net.Core)
template with individual user account authorization.Project->MyProject Properties...
, copied URL with https to App Url.services.AddMvc(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
Startup
.