0

So I need to setup an Https server with express/node.js. The sample code related to the topic I find is like(node.js):

var options = {
  key: fs.readFileSync('.keys/server.key'),
  cert: fs.readFileSync('.keys/server.crt'),
  requestCert: true,
  ca: [fs.readFileSync('./keys/ca.crt')]
};

express:

var options = {
  key: fs.readFileSync('.keys/server.key'),
  cert: fs.readFileSync('.keys/server.crt'),
  passphrase: '1234'
};

So my question is simply how to generate those 2 files (server.key, server.crt) with Openssl?

Not that matters, but this server is only setup for releasing iOS enterprise app's ipa file. I don't really care about security, just Apple requires Https rather than Http.

jww
  • 97,681
  • 90
  • 411
  • 885
Fate Riddle
  • 364
  • 1
  • 3
  • 15

1 Answers1

0

The command stated in this answer will generate two files, key.pem and cert.pem, just rename them to server.key and server.crt (or use these names in the command). Note that this generates a self-signed certificate.

Community
  • 1
  • 1
Brett Donald
  • 6,745
  • 4
  • 23
  • 51