From 0432329d41251d9b8ed3429a2c600f24860ffab4 Mon Sep 17 00:00:00 2001 From: hueso Date: Fri, 23 Jan 2026 13:18:35 -0300 Subject: [PATCH] cert/key from file --- bbpay.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bbpay.ts b/bbpay.ts index 0b94970..bfe44b1 100644 --- a/bbpay.ts +++ b/bbpay.ts @@ -11,6 +11,7 @@ import https from 'https'; import http from 'http'; import debug from 'debug'; import axiosDebugLog from 'axios-debug-log'; +import fs from 'fs'; // Load environment variables from .env file dotenv.config(); @@ -43,6 +44,7 @@ app.use(express.json()); class BBPay { protected oauth: AxiosInstance; protected cert: string; + protected key: string; protected verifySsl: string; protected baseUrl: string; protected params: any; @@ -60,10 +62,10 @@ class BBPay { }, }); - this.cert = 'cert.pem'; - this.key = 'key.pem' - this.verifySsl = 'bb.pem'; - this.baseUrl = process.env.ITP_API_URL; + this.cert = fs.readFileSync('cert.pem').toString(); + this.key = fs.readFileSync('key.pem').toString(); + this.verifySsl = fs.readFileSync('bb.pem').toString(); + this.baseUrl = process.env.ITP_API_URL as string; this.params = { numeroConvenio: 701,