Chrome拒绝自签名证书却认可.NET开发者证书的原因排查
ASP.NET Core MVC自签名证书在Chrome中无效,但.NET开发者证书正常的原因?
我尝试为ASP.NET Core MVC网站添加自签名证书,但Chrome浏览器提示“证书无效”,拒绝接受该证书。该自签名证书是通过PowerShell创建的,参考了官方的证书创建和导出文档指引。
自签名证书配置及报错情况
对应的appsettings.json配置如下:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "Kestrel": { "Endpoints": { "MyHttpEndpoint": { "Url": "http://localhost:5000" }, "MyHttpsEndpoint": { "Url": "https://localhost:5001", "SslProtocols": [ "Tls12", "Tls13" ], "Certificate": { "Path": "mypfx.pfx", "Password": "1234" } } } } }
Chrome浏览器报错截图:
.NET开发者证书配置及正常情况
当我使用.NET开发者证书时,Chrome可正常接受网站的HTTPS连接,此时appsettings.json配置如下:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "Kestrel": { "Endpoints": { "MyHttpEndpoint": { "Url": "http://localhost:5000" }, "MyHttpsEndpoint": { "Url": "https://localhost:5001", } } } }
Chrome正常访问截图:
请问出现这种差异的原因是什么?
内容的提问来源于stack exchange,提问作者yogihosting
相关产品推荐
相关产品推荐

