From 9e054203d4f0f58d8b7c315c200e67350b9f5c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Fern=C3=A1ndez=20Gim=C3=A9nez?= Date: Tue, 24 Mar 2026 09:17:42 +0100 Subject: [PATCH] feat(client): add HTTPS agent configuration for secure requests --- src/fs/client.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fs/client.ts b/src/fs/client.ts index f242aa3..7973a5a 100644 --- a/src/fs/client.ts +++ b/src/fs/client.ts @@ -1,16 +1,22 @@ import axios, { AxiosInstance } from 'axios'; +import https from 'https'; import { env } from '../env.js'; export class FacturaScriptsClient { private client: AxiosInstance; constructor() { + const httpsAgent = process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' + ? new https.Agent({ rejectUnauthorized: false }) + : undefined; + this.client = axios.create({ baseURL: `${env.FS_BASE_URL}/api/${env.FS_API_VERSION}`, headers: { 'token': env.FS_API_TOKEN, 'Content-Type': 'application/json', }, + httpsAgent, }); }