Author Image

pedrolucasneto

Aug 5, 2024

Acessar Certificado .p12 no Deploy com Vercel

certificado .p12verceldeployNode.jsexpressHTTPSAgentAxios

alguma dica de como acessar os arquivos de certificado .p12 no deploy no vercel? Estou usando express - node.js

Respostas (1):
Avatar discord do usuario rubenskuhl

rubenskuhl

05/08/2024

// alternatively you can use pfx + password as well here
const httpsAgent = new https.Agent({
cert: fs.readFileSync(process.env.PUBLIC_CERTIFICATE_PATH),
key: fs.readFileSync(process.env.PRIVATE_KEY_PATH),
ca: fs.readFileSync(process.env.CA_CHAIN_PATH)
})

axios.get(url, { httpsAgent })