From a077d65a3e15bf487a4011a1fdfa613dbe5be61d Mon Sep 17 00:00:00 2001 From: Martin Sefcik Date: Mon, 29 Jan 2024 15:49:08 +0100 Subject: [PATCH] fix(#1419): fixed ignored SSL verification and client certificates configuration when using SOCKS proxy (#1420) --- packages/bruno-cli/src/runner/run-single-request.js | 8 +++++--- packages/bruno-electron/src/ipc/network/index.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/bruno-cli/src/runner/run-single-request.js b/packages/bruno-cli/src/runner/run-single-request.js index b19289eed..e17304cf4 100644 --- a/packages/bruno-cli/src/runner/run-single-request.js +++ b/packages/bruno-cli/src/runner/run-single-request.js @@ -158,9 +158,11 @@ const runSingleRequest = async function ( } if (socksEnabled) { - const socksProxyAgent = new SocksProxyAgent(proxyUri); - request.httpsAgent = socksProxyAgent; - request.httpAgent = socksProxyAgent; + request.httpsAgent = new SocksProxyAgent( + proxyUri, + Object.keys(httpsAgentRequestFields).length > 0 ? { ...httpsAgentRequestFields } : undefined + ); + request.httpAgent = new SocksProxyAgent(proxyUri); } else { request.httpsAgent = new PatchedHttpsProxyAgent( proxyUri, diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js index 58e7dc638..82c7c8798 100644 --- a/packages/bruno-electron/src/ipc/network/index.js +++ b/packages/bruno-electron/src/ipc/network/index.js @@ -169,9 +169,11 @@ const configureRequest = async ( } if (socksEnabled) { - const socksProxyAgent = new SocksProxyAgent(proxyUri); - request.httpsAgent = socksProxyAgent; - request.httpAgent = socksProxyAgent; + request.httpsAgent = new SocksProxyAgent( + proxyUri, + Object.keys(httpsAgentRequestFields).length > 0 ? { ...httpsAgentRequestFields } : undefined + ); + request.httpAgent = new SocksProxyAgent(proxyUri); } else { request.httpsAgent = new PatchedHttpsProxyAgent( proxyUri,