bootbot icon indicating copy to clipboard operation
bootbot copied to clipboard

HTTPS server feature

Open mrpinkcat opened this issue 5 years ago • 2 comments

HTTPS server feature

The pull request from the issue #182

You can now start a HTTPS server with credentials

const port = 3000;

const privateKey = fs.readFileSync(env_1.config.tls.key, 'utf8');
const certificate = fs.readFileSync(env_1.config.tls.cert, 'utf8');
const credentials = { key: privateKey, cert: certificate };

new BootBot(...).start(port, credentials);

mrpinkcat avatar Sep 12 '19 09:09 mrpinkcat

@Charca What do you think about that ?

mrpinkcat avatar Sep 13 '19 09:09 mrpinkcat

If you have different certificates files, you cans use the next:


const https_option = {
  key: fs.readFileSync('path_key_file.key', 'utf8'),
  cert: fs.readFileSync('path_cert_file.crt', 'utf8'),
  ca: [
    fs.readFileSync('path_DomainValidationSecureServerCA_cert_file.crt'),
    fs.readFileSync('USERTrustpath_cert_file.crt')
  ]
}

bot.start(process.env.PORT, https_option)

That works for me 👍

Alfirian avatar Dec 04 '20 17:12 Alfirian