From df449eba30b684f2242a59f22f04cbc5ef8eef02 Mon Sep 17 00:00:00 2001 From: petruki <31597636+petruki@users.noreply.github.com> Date: Fri, 23 Jun 2023 12:30:34 -0700 Subject: [PATCH] Relay: default allow self-sign cert --- src/client/relay/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/client/relay/index.js b/src/client/relay/index.js index 5629d6c..e0b8ac6 100644 --- a/src/client/relay/index.js +++ b/src/client/relay/index.js @@ -1,12 +1,8 @@ import axios from 'axios'; import https from 'https'; import { StrategiesToRelayDataType, RelayMethods } from '../../models/config'; -import { checkHttpsAgent } from '../../external/switcher-api-facade'; -const agent = async (url) => { - const rejectUnauthorized = !(await checkHttpsAgent(url)); - return new https.Agent({ rejectUnauthorized }); -}; +const agent = new https.Agent({ rejectUnauthorized: false }); export function resolveNotification(relay, entry, environment) { const url = relay.endpoint[environment]; @@ -48,7 +44,7 @@ export async function resolveVerification(relay, environment) { async function post(url, data, headers) { try { - return await axios.post(url, data, { httpsAgent: agent(url) }, headers); + return await axios.post(url, data, { httpsAgent: agent }, headers); } catch (error) { throw new Error(`Failed to reach ${url} via POST`); } @@ -56,7 +52,7 @@ async function post(url, data, headers) { async function get(url, data, headers) { try { - return await axios.get(`${url}${data}`, { httpsAgent: agent(url) }, headers); + return await axios.get(`${url}${data}`, { httpsAgent: agent }, headers); } catch (error) { throw new Error(`Failed to reach ${url} via GET`); }