title: Node.js HTTPS server ERR_EMPTY_RESPONSE
body: <p>I created the server.key and server.csr files using <code>openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr</code>. I created a SSL certificate with startssl.com which gave me a certificate file. Then in my node.js application I read the key and certificate files:</p>
  
  <pre><code>var app = module.exports = express.createServer({
    key: fs.readFileSync('server.key'),
    cert: fs.readFileSync('server.cert')
  });
  </code></pre>
  
  <p>But, now I get an empty response from my application, a "No data received" message. What could be causing this? I'm very new to SSL and how it all works, so any help with this is very much appreciated.</p>
  
  <p>More info: I generated the two files, key and csr files, on my VPS server (production server), and now I'm trying to get them to work on my localhost (firstly, before I commit my code to production; I have to test that it works before making a git commit). So, it could be due to the fact that my localhost (development environment) is on a different domain from my VPS server (production environment). Could this be the case? If so, how can I make it to where the localhost and production environment use the same certificate?</p>
  
  <p>Or, would you suggest I create another certificate for my development environment? The only problem I see with that, is that I wouldn't have a domain for my dev environment because it's done locally. I'd rather much use the same certificate (even if that means a broken lock icon or something on localhost) for the sake of simplicity.</p>