title: Dotnet 5 on mac with IS4 returns SSL connection could not be established
body: <p>I have an app with 3 project, Data, API, and IS4.</p>
  <p>IS4 returns <code>ERR_CERT_AUTHORITY_INVALID</code> 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.</p>
  <p>However, the API resource rejects me both at postman, safari, and chrome</p>
  <p>It gave me this:</p>
  <pre><code>      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'.                                                        │
         ---&gt; System.IO.IOException: IDX20804: Unable to retrieve document from: 'System.String'.                                                                │
         ---&gt; System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.                                            │
         ---&gt; 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)          │
  </code></pre>
  <p>What is that? I tried most solutions I found on google, <a href="https://stackoverflow.com/questions/52939211/the-ssl-connection-could-not-be-established">this</a>, <a href="https://stackoverflow.com/questions/63626244/asp-net-core-3-the-remote-certificate-is-invalid-on-macos">this</a>, and <a href="https://stackoverflow.com/questions/54435551/invalidoperationexception-idx20803-unable-to-obtain-configuration-from-pii">this</a>. I can't get it work even after these 2 commands:</p>
  <pre><code>dotnet dev-certs https --clean
  dotnet dev-certs https --trust
  </code></pre>
  <p>Can anyone tell me what is happening? I believe it was not like this before upgrading from .net core 3.1</p>
  <p>Thanks</p>