title: How to disable ssl certificate validation upon OpenId connect in .Net Core 3.1?
body: <p>I'm trying to connect in a development environment to a open id authority with it's ip address. Obviously in this scenario the ssl validation will fail. I'd like to bypass it, without any luck so far. I've found the following answers regarding this topic:</p>
  <ul>
  <li>Setting the RequireHttpsMetadata to false in the OpenIdConnectOptions class.</li>
  <li>Using the code below:</li>
  </ul>
  <blockquote>
  <p>ServicePointManager.ServerCertificateValidationCallback +=
  (sender, cert, chain, sslPolicyErrors) =&gt; true;</p>
  </blockquote>
  <p>When my app tries to access the oidc authority I recieve the same error:</p>
  <blockquote>
  <p>An unhandled exception occurred while processing the request.
  AuthenticationException: The remote certificate is invalid according
  to the validation procedure.
  System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken
  message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo
  exception)</p>
  <p>HttpRequestException: The SSL connection could not be established, see
  inner exception.
  System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream
  stream, SslClientAuthenticationOptions sslOptions, CancellationToken
  cancellationToken)</p>
  <p>IOException: IDX20804: Unable to retrieve document from:
  'https://172.11.0.11:1111/MY_APP/.well-known/openid-configuration'.
  Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(string
  address, CancellationToken cancel)</p>
  <p>InvalidOperationException: IDX20803: Unable to obtain configuration
  from:
  'https://172.11.0.11:1111/MY_APP/.well-known/openid-configuration'.
  Microsoft.IdentityModel.Protocols.ConfigurationManager.GetConfigurationAsync(CancellationToken
  cancel)</p>
  </blockquote>