title: Certificate issue in Kestrel ssl JSON configuration
body: <p>Referencing to <a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-2.2" rel="nofollow noreferrer">Kestrel documentation</a> is it possible to configure https using appsettings.json file:</p>
  
  <pre><code>  "HttpsInlineCertStore": {
      "Url": "https://+:5002",
      "Certificate": {
        "Subject": "&lt;coma separated multi-line subject name&gt;",
        "Store": "Root",
        "Location": "LocalMachine"
    }
  </code></pre>
  
  <p>This certificate exist for sure and next code returns finds it:</p>
  
  <pre><code>        using (var certStore = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
          {
              certStore.Open(OpenFlags.ReadOnly);
              var certificates = certStore.Certificates.Find(
                  X509FindType.FindBySubjectDistinguishedName, "&lt;coma separated multi-line subject name&gt;", true);
  
              return certificates .Count &gt; 0 ? certificates [0] : null;;
          }
  </code></pre>
  
  <p>At the same time if to search certificate by X509FindType.FindBySubjectName it founds nothing and I believe this is the issue even though <a href="https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509findtype?view=netframework-4.7.2#System_Security_Cryptography_X509Certificates_X509FindType_FindBySubjectDistinguishedName" rel="nofollow noreferrer">microsoft</a> says that FindBySubjectDistinguishedName is more specific search.</p>