title: mongodump and mongorestore with SSL
body: <p><strong>Getting <code>mongodump</code> and <code>mongorestore</code> work with security quite troublesome.</strong></p>
  
  <p>I have <code>mongod</code> v3.4.1 with <code>requireSSL</code> running at <code>192.168.99.100</code>. It is IP address of VirtualBox docker machine running on my Windows. It is just for testing of-cause.</p>
  
  <p>The instance already configured to use TLS/SSL both server and client signed with the same CA. I use the IP address for <code>mongod</code> Common Name to allow hostname validation. The authentication already enabled to accept my client certificate.</p>
  
  <p>So everything is working. I can connect to it like this:</p>
  
  <pre><code>mongo --ssl --host 192.168.99.100 --sslCAFile rootCA.pem --sslPEMKeyFile me.pem
  </code></pre>
  
  <p>but now I can't get both <code>mongodump</code> and <code>mongorestore</code> working:</p>
  
  <pre><code>mongodump --ssl --host 192.168.99.100 --sslCAFile rootCA.pem --sslPEMKeyFile me.pem -d olddb
  mongorestore --ssl --host 192.168.99.100 --sslCAFile rootCA.pem --sslPEMKeyFile me.pem -d newdb --dir=dump/olddb
  </code></pre>
  
  <p>Both return this error:</p>
  
  <pre><code>2017-01-13T04:28:03.881+0800    Failed: error connecting to db server: no reachable servers, openssl error: Host validation error
  </code></pre>
  
  <p>I have been trying to turn off client certificate, use username/password but still did not work. I need to remove the SSL in order to make it work.</p>
  
  <p><strong>That means I can only use <code>preferSSL</code> in production.</strong>
  There is no way to bypass SSL in localhost if I stick with <code>requireSSL</code>. </p>
  
  <p>Anyone getting the same error? Is it a known issue?</p>