From b9e93c52f68d231e1a547a65ff94647fcf4ed8b9 Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Wed, 8 Nov 2023 23:01:54 -0300 Subject: [PATCH] feat: parse certificado from base64 string --- src/lhisp-oauth-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index a8920e1..f18231b 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -36,7 +36,7 @@ export class LhispOauthClient { constructor(params: LhispOauthClientConstructorParams) { if (params.certificado) { this.agent = new https.Agent({ - pfx: params.certificado, + pfx: Buffer.isBuffer(params.certificado) ? params.certificado : Buffer.from(params.certificado, "base64"), passphrase: params.senhaCertificado, rejectUnauthorized: false, });