title: Node.js/Express.js Chain Certificate Not working
body: <p>I have an SSL server in Express, which is not working on all browsers (unless the user manually trusts the website) since some browsers require the chain certificate (we have our own intermediate certificate). I've put our intermediate and chain certificate in one .crt file. The chain + intermediate certificate is in the <code>INT_CERT_FILE</code> variable. It does not seem to work. I am using <a href="http://www.digicert.com/help" rel="nofollow noreferrer">http://www.digicert.com/help</a>, as well as running <code>openssl s_client -connect tasker.adnxs.net:443 -showcerts | grep &quot;^ &quot;</code> to check, but it does not seem to be returning the intermediate + chain certificate.</p>
  <p>Here's how I'm setting it up:</p>
  <pre><code>var fs = require(&quot;fs&quot;);
  var https = require(&quot;https&quot;);
  var express = require(&quot;express&quot;);
  
  var KEY_FILE = fs.readFileSync(&quot;path/to/key/file.key&quot;);
  var CERT_FILE = fs.readFileSync(&quot;path/to/crt/file.crt&quot;);
  var INT_CERT_FILE = fs.readFileSync(&quot;path/to/intermediate and chain crt.crt&quot;);
  
  var _app_https = express();
  var _server_https = null;
  
  _server_https = https.createServer({
      key: KEY_FILE,
      cert: CERT_FILE,
      ca: INT_CERT_FILE
  }, _app_https).listen(443);
  </code></pre>
  <p>When visiting it on Firefox, Firefox does not recognise its identity and requires it to be manually trusted. How can I fix this issue?</p>
  <p>Thanks,</p>