具有IS4的Mac上的Dotnet 5返回无法建立SSL连接 [英] Dotnet 5 on mac with IS4 returns SSL connection could not be established

查看:174
本文介绍了具有IS4的Mac上的Dotnet 5返回无法建立SSL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含3个项目,数据,API和IS4的应用.

I have an app with 3 project, Data, API, and IS4.

IS4在chrome上返回 ERR_CERT_AUTHORITY_INVALID ,我认为这是针对asp.net核心的mac版SSL漏洞.当我在野生动物园中打开时,它的工作正常,因此我继续尝试使用前端应用程序请求API资源.

IS4 returns ERR_CERT_AUTHORITY_INVALID on chrome, I figure this is the SSL bug that has been happening for mac for asp.net core. It works just fine when I opened on safari so I continue to try to use my front end app to request to the API resource.

但是,API资源在邮递员,野生动物园和Chrome浏览器上都拒绝了我

However, the API resource rejects me both at postman, safari, and chrome

它给了我这个

      Content root path: /Users/src/API                  │
fail: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[3]                                                                                        │
      Exception occurred while processing message.                                                                                                             │
      System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'.                                                        │
       ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'System.String'.                                                                │
       ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.                                            │
       ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot│
         at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)                                          │
         at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean i│
sApm)                                                                                                                                                          │
         at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, Cancellation│
Token cancellationToken)                                                                                                                                       │
         --- End of inner exception stack trace ---                                                                                                            │
         at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, Cancellation│
Token cancellationToken)                                                                                                                                       │
         at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)                    │
         at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)     │
         at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)          │

那是什么?我尝试了在Google上找到的大多数解决方案,

What is that? I tried most solutions I found on google, this, this, and this. I can't get it work even after these 2 commands:

dotnet dev-certs https --clean
dotnet dev-certs https --trust

谁能告诉我发生了什么事?我相信从.net core 3.1升级之前不是这样的

Can anyone tell me what is happening? I believe it was not like this before upgrading from .net core 3.1

谢谢

推荐答案

遵循所有其他解决方案之后,唯一对我有用的解决方案是在Mac上完全重新安装dotnet

After following all other solution, the only one that worked for me was to completely reinstall dotnet on my mac

按照步骤进行卸载,然后重新安装干净.

Follow this step to uninstall, then reinstall clean.

这篇关于具有IS4的Mac上的Dotnet 5返回无法建立SSL连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆