title: How to configure https in sails.js with .crt file
body: <p>I am running sailsJS on nodeJS and am trying to setup HTTPS, however I seem to be stuck. I can acess my site at <a href="http://example.com:443" rel="nofollow noreferrer">http://example.com:443</a>, but not at <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a></p>
  
  <p>This question is similar to <a href="https://stackoverflow.com/q/17755916">how to configure https in sails.js</a> except that I do not have .pem files, rather .crt and .key files that I got from Media Temple's QuickSSL.  </p>
  
  <p>This is what I have in <em>config/bootstrap.js</em></p>
  
  <pre class="lang-js prettyprint-override"><code>module.exports.bootstrap = function (cb) {
      var fs = require('fs');
      sails.config.express.serverOptions = {
          key: fs.readFileSync('/etc/ssl/private/mysite.com.key'),
          cert: fs.readFileSync('/etc/ssl/crt/mysite.com.crt'),
          ca: [fs.readFileSync('/etc/ssl/crt/mysite.com-geotrust.crt')]
      };
      cb();
  };
  </code></pre>
  
  <p>I set the port number to 443 in <em>config/local.js</em></p>
  
  <p>Can anyone point me in the right direction?</p>