title: Cannot Connect to AWS Database using TLS with Server CA Validation
body: <p>AWS documentation states that to connect to my DocumentDB Cluster, I need to use a query string that ends like so <code>?ssl_ca_certs=rds-combined-ca-bundle.pem&amp;replicaSet=rs0</code>. <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/security.encryption.ssl.html" rel="noreferrer">It is a root certificate chain</a> that my Client should validate. I should not need a <a href="http://mongodb.github.io/mongo-csharp-driver/2.3/reference/driver/ssl/" rel="noreferrer">Client Certificate</a>.</p>
  
  <p>Using the MongoDB C# driver and this specific query, with the <code>.pem</code> file in the same directory, I cannot establish the connection. If I use the same <code>.pem</code> file and query string from the Mongo Shell, I can correctly connect to my database. It only doesn't work from my .net core application, that also runs on AWS.</p>
  
  <p>By removing TLS from the Cluster and removing the <code>ssl_ca_certs</code> option from the query, I can connect correctly to my Cluster.</p>
  
  <p>I thought I could convert my <code>.pem</code> file to a <code>.pfx</code> using <code>openssl</code>, but I have to give the <code>.pfx</code> a password and <a href="http://mongodb.github.io/mongo-csharp-driver/2.3/reference/driver/ssl/" rel="noreferrer">MongoDB documentation states that</a> </p>
  
  <blockquote>
    <p>It is imperative that when loading a certificate with a password, the
    PrivateKey property not be null. If the property is null, it means
    that your certificate does not contain the private key and will not be
    passed to the server.</p>
  </blockquote>
  
  <p><strong>How can I use <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/security.encryption.ssl.html" rel="noreferrer">the <code>.pem</code> file provided by Amazon AWS</a> to connect to my database using the C# MongoDB driver?</strong></p>