title: Certificate error invoking gRPC service with HTTPS under .Net 5: UntrustedRoot
body: <p>I am trying to HTTPS connect my gRPC client and service, both running under .Net 5 on my local Windows 10 machine. Now I am getting this certificate error and not sure how to fix it:</p>
  <pre><code>    Status(StatusCode=\&quot;Internal\&quot;, Detail=\&quot;Error starting gRPC call. 
      HttpRequestException: The SSL connection could not be established, see inner exception. 
      
      AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot\&quot;, DebugException=\&quot;System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.\r\n 
  ---&gt; System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot\r\n   at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)\r\n   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)\r\n   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)\r\n   --- End of inner exception stack trace ---\r\n   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)\r\n   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\r\n   at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\r\n   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)\r\n   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\r\n   at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)\&quot;)
  </code></pre>
  <p>I tried to install a dev certificate by running the commend below, but it seems one have already exist:</p>
  <p><a href="https://i.stack.imgur.com/QLG9c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QLG9c.png" alt="enter image description here" /></a></p>
  <p>And it appears that I have this cert under both of my Personal and Trusted Root stores</p>
  <p><a href="https://i.stack.imgur.com/0lWDI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0lWDI.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/cJFlA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cJFlA.png" alt="enter image description here" /></a></p>
  <p>I do noticed however, that the cert exists in my stores is &quot;IIS Express Development Certificate&quot;, instead of &quot;ASP.NET Core HTTPS development certificate&quot;. Dose that matter? If so, how do I get the correct cert installed? If not, what else am I missing?</p>