title: How to create Node.js secure server with `https.js`?
body: <p>Trying to create a secure server for nodeJs application using <code>https.js</code> NPM module.</p>
  
  <p><code>app.js</code>:</p>
  
  <pre><code>var http = require('https'),
      fs = require('fs');
  
  var cert = {
      key:     fs.readFileSync('/opt/cert/server.key.pem'),
      cert:    fs.readFileSync('/opt/cert/server.cert.pem')
  };
  
  console.log(cert);
  
  var server = http.createServer(cert, function (req, res) {
      console.log("I am the listener!");
      res.write('Hello World!'); //write a response to the client
      res.end(); //end the response
  });
  
  server.on('error', function (e) {
      // Handle your error here
      console.log(e);
  });
  
  server.listen(3005, function(e) {
      console.log("bambam");
      console.log(e);
  });
  </code></pre>
  
  <p>Tried locally and on remote server. The port is listening since the browser doesn't say that connection refused but it does say that there's no response.</p>