title: .NET C# "The remote certificate is invalid according to the validation procedure"
body: <p>I am facing an issue while making a <code>REST</code> call by using <code>HttpClient</code> object.</p>
  <ol>
  <li>I have an application developed in .NET Core that runs on a Windows and Linux machine.</li>
  <li>This application makes a call to <code>https://dev.example.com/</code>.</li>
  <li>The SSL certificate is valid, and it has all required intermediate and chained certificates.</li>
  <li>This certificate is issued for all the URLs that have the domain <code>*.example.com</code>. That means the same certificate should work for <code>dev.example.com</code>, <code>test.example.com</code>, <code>stage.example.com</code>, and also for <code>prod.example.com</code>.</li>
  <li>The .NET core application is working fine when we execute it on a Windows 10 machine. However we face issues when we execute it on a Windows 7 machine.</li>
  </ol>
  <p>I also tried to use the certificate file (.cer) while sending the request by using the <code>HttpClientHandler</code> class. On the Windows 7 machine, I also tried to download the certificate and added it in the trusted certificates.
  However, I still face the issue.</p>
  <p>Below is the stack trace.</p>
  <pre class="lang-none prettyprint-override"><code>ERROR ======================= :: System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---&gt; System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
     at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
  --- End of stack trace from previous location where exception was thrown ---
     at System.Net.Security.SslState.ThrowIfExceptional()
     at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
     at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
     at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
     at System.Net.Security.SslStream.&lt;&gt;c.&lt;AuthenticateAsClientAsync&gt;b__47_1(IAsyncResult iar)
     at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
  --- End of stack trace from previous location where exception was thrown ---
     at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
     --- End of inner exception stack trace ---
     at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
     at System.Threading.Tasks.ValueTask`1.get_Result()
     at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
     at System.Threading.Tasks.ValueTask`1.get_Result()
     at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
     at System.Threading.Tasks.ValueTask`1.get_Result()
     at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
     at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
     at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
  </code></pre>
  <h2>Update</h2>
  <p>I tried to get the certificate information with IE web browser.</p>
  <p>On the Windows 10 system, I can see the complete certificate information. However, on the Windows 7 system I can see the message as</p>
  <blockquote>
  <p>The certificate cannot be verified up to a trusted certificate authority</p>
  </blockquote>