title: Mongoose SSL, connection not accepted
body: <p>So it took me a bit to set up a repl set with SSL and authorization. However, I have it set up and working finally, and can connect via command line providing the appropriate parameters. I'm trying to do the same thing with mongoose, however I keep getting an error in the mongodb logs, as follows: <code>AssertionException handling request, closing client connection: 17189 The server is configured to only allow SSL connections</code> Even though I specified all the ssl options.</p>
  
  <p>My code is as follows: </p>
  
  <pre><code>var m = require('mongoose');
  
  var key = fs.readFileSync('/home/node/mongodb/mongodb.pem');
  var ca = [fs.readFileSync('/home/node/mongodb/ca.pem')];
  
  var o = {
      server: {
          sslValidate:true,
          sslCA: ca,
          sslKey: key,
          sslCert:key
      },
      user: '****',
      pass: '****'
  };
  
  m.connect('mongodb://dbAddr/dbName', o)
  </code></pre>
  
  <p>I've tried setting sslValidate to <code>false</code>, same issue. I've tried without CA, cert, and/or key in multiple combinations. When I connect via command line it requires me to provide CA, and key+cert PEM file. So I figured the mongoose client would require these as well. I've tried both <code>server</code> and <code>replset</code> keys with the same exact outcome. I've even specified authSource(authDB), even though it appears this is not part of the problem, this still yields the same results.</p>
  
  <p>I'm really confused especially since I have no problem doing this exact same thing via the <code>mongo</code> command.</p>
  
  <p>My mongo shell command is as follows: </p>
  
  <pre><code>mongo --host db1 --ssl --sslPEMKeyFile /etc/mongodb/mongodb.pem  --sslCAFile /etc/mongodb/ca.pem -u *** -p *** --authenticationDatabase dbName
  </code></pre>