title: Connect to Cassandra Apache with SSL using cassandra-driver in Node.js
body: <p>I try connect to my Cassandra but I have probably wrongly configured. I run it on localhost. Cassandra has generated certificated and add on. In cqlsh there are no errors with flag --ssl. My fragment code is </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var tls = require('tls');
  var fs = require('fs');
  var options = {
   key : fs.readFileSync('client-key.pem'),
   cert : fs.readFileSync('client-cert.pem'),
   ca : [fs.readFileSync('server-cert.pem')]
  };
  var client = new cassandra.Client({
    contactPoints : ['127.0.0.1'],
    authProvider : new cassandra.auth.PlainTextAuthProvider('cassandra', 'cassandra'),
    sslOptions : tls.connect(options)
   });</code></pre>
  </div>
  </div>
  </p>
  
  <p>what I'm doing wrong? 
  Please help!</p>