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 {
const Http = Axios.create({
httpsAgent: new httpsAgent.Agent({
ca: await FS.readFile(CA),
key: await FS.readFile(CA_KEY)
})
httpsAgent: new httpsAgent.Agent(
CA && CA_KEY
? {
ca: await FS.readFile(CA),
key: await FS.readFile(CA_KEY)
}
: {}
)
})
const sanitizeLNDError = (message = '') => {