Correct key semantics

This commit is contained in:
Daniel Lugo 2021-10-09 15:33:23 -04:00
parent e51bca7bf7
commit a0c778b9c3

View file

@ -296,13 +296,12 @@ const server = program => {
res.status(500).send({ status: 500, errorMessage: 'internal error' }) res.status(500).send({ status: 500, errorMessage: 'internal error' })
}) })
const CA = const CA = program.httpsCert
program.httpsCert || LightningServices.servicesConfig.lndCertPath const CA_KEY = program.httpsCertKey
const CA_KEY = program.httpsCertKey || CA.replace('cert', 'key')
const createServer = () => { const createServer = () => {
try { try {
if (LightningServices.servicesConfig.lndCertPath && program.useTLS) { if (program.useTLS) {
const key = FS.readFileSync(CA_KEY, 'utf-8') const key = FS.readFileSync(CA_KEY, 'utf-8')
const cert = FS.readFileSync(CA, 'utf-8') const cert = FS.readFileSync(CA, 'utf-8')