Check existence of cert before providing to readfile()

This commit is contained in:
Daniel Lugo 2021-10-12 12:33:01 -04:00
parent bc13eed372
commit 74ebda03b2

View file

@ -52,10 +52,14 @@ module.exports = async (
) => { ) => {
try { try {
const Http = Axios.create({ const Http = Axios.create({
httpsAgent: new httpsAgent.Agent({ httpsAgent: new httpsAgent.Agent(
ca: await FS.readFile(CA), CA && CA_KEY
key: await FS.readFile(CA_KEY) ? {
}) ca: await FS.readFile(CA),
key: await FS.readFile(CA_KEY)
}
: {}
)
}) })
const sanitizeLNDError = (message = '') => { const sanitizeLNDError = (message = '') => {