title: Disable SSL certificate verification in default injected IHttpClientFactory
body: <p>In Startup.cs I inject an <code>IHttpClientFactory</code> service:</p>
  <pre><code>services.AddHttpClient();
  </code></pre>
  <p>I can then create a new <code>HttpClient</code> through</p>
  <pre><code>public MyClass(IHttpClientFactory httpClientFactory, IOptions&lt;MyClassOptions&gt; options)
  {
      _httpClient = httpClientFactory.CreateClient();
      // ...
  }
  </code></pre>
  <p><code>MyClass</code> does some API access; the base URL is passed in the <code>options</code> object.</p>
  <p>For testing I set up a dummy instance of the API, which uses a self-signed SSL certificate. Unfortunately, this certificate is (correctly) recognized as invalid:</p>
  <pre><code>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.
  </code></pre>
  <p>How can I disable certificate verification at the factory layer, i.e. directly in the <code>ConfigureServices</code> method?</p>
  <p>I found <a href="https://stackoverflow.com/questions/57283898/ignore-ssl-connection-errors-via-ihttpclientfactory">this question</a>, but it seemed to use some custom <code>HttpClient</code> implementation (?), while I want to target the default one. The following does not work (DI picks the wrong constructor and subsequently fails):</p>
  <pre><code>services.AddHttpClient&lt;IMyClass, MyClass&gt;();
  </code></pre>
  <p><a href="https://stackoverflow.com/a/55496011/8528014">This answer</a> suggests to supply a name for the configured <code>HttpClient</code>, but it passes some magic string, which I would like to avoid (<code>MyClass</code> is located in a class library designed to be also used by others). Passing no name does not work either, since <code>AddHttpClient</code> then merely returns an <code>IServiceCollection</code> object.</p>