title: setting up ssl with express server
body: <p>I was following this tutorial of setting up ssl within node.
  <a href="http://blog.nategood.com/nodejs-ssl-client-cert-auth-api-rest" rel="nofollow">http://blog.nategood.com/nodejs-ssl-client-cert-auth-api-rest</a></p>
  
  <p>Here the certificate files are loaded by passing an options object to createServer</p>
  
  <pre><code>var options = {
      key:    fs.readFileSync('ssl/server.key'),
      cert:   fs.readFileSync('ssl/server.crt'),
      ca:     fs.readFileSync('ssl/ca.crt'),
      requestCert:        true,
      rejectUnauthorized: false
  };
  
  https.createServer(options, function (req, res) {
      if (req.client.authorized) {
          res.writeHead(200, {&amp;quot;Content-Type&amp;quot;: &amp;quot;application/json&amp;quot;});
          res.end('{&amp;quot;status&amp;quot;:&amp;quot;approved&amp;quot;}');
      } else {
          res.writeHead(401, {&amp;quot;Content-Type&amp;quot;: &amp;quot;application/json&amp;quot;});
          res.end('{&amp;quot;status&amp;quot;:&amp;quot;denied&amp;quot;}');
      }
  }).listen(443);
  </code></pre>
  
  <p>However I am using express for my application server needs.</p>
  
  <p>The flow goes something like this :</p>
  
  <pre><code>var express = require('express');
  var app = express();
  
  app.get('/', function(req, res){
    res.send('hello world');
  });
  
  app.listen(3000);
  </code></pre>
  
  <p>Where do I pass in the certificate details ?</p>