Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2230

TLS Certificate validation fails with RemoteCertificateNameMismatch

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.4, 2.5
    • Component/s: Connectivity
    • Labels:
    • Environment:
      ASP.NET core 2.0
      microsoft/aspnetcore:2.0 docker container

      When trying to connect to a MongoDB replica set via TLS I'm getting a RemoteCertificateNameMismatch error. This only happens when running in the docker container (not sure if it's a Linux thing or just Docker) and runs absolutely fine on Windows.

      The Subject of the certificate looks like:
      C=US, O=MongoDirector.com., CN=*.servers.mongodirector.com

      The connection string looks similar to:
      mongodb://SG-rsname-8081.servers.mongodirector.com:27017,SG-rsname-8082.servers.mongodirector.com:27017/supervisor-dev?replicaSet=RS-rsname-0&ssl=true

      I thought maybe it was a .NET core issue on Linux. But I created a simple http call to a URI that also uses a wildcard certificate and it worked fine.

            Assignee:
            vincent.kam@mongodb.com Vincent Kam (Inactive)
            Reporter:
            dane.barentine@quest.com Dane Barentine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: