diff --git a/src/plus/gitlab/gitlab.ts b/src/plus/gitlab/gitlab.ts index 6331903..8964aa9 100644 --- a/src/plus/gitlab/gitlab.ts +++ b/src/plus/gitlab/gitlab.ts @@ -729,15 +729,10 @@ $search: String! const agent = this.getProxyAgent(provider); const ignoreSSLErrors = this.getIgnoreSSLErrors(provider); - let previousRejectUnauthorized; + const fetchMethod: FetchLike = ignoreSSLErrors === 'force' ? insecureFetch : fetch; try { - if (ignoreSSLErrors === 'force') { - previousRejectUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED; - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; - } - - rsp = await fetch(url, { + rsp = await fetchMethod(url, { headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' }, agent: agent as any, ...options, @@ -750,10 +745,6 @@ $search: String! throw new ProviderFetchError('GitLab', rsp); } finally { - if (ignoreSSLErrors === 'force') { - process.env.NODE_TLS_REJECT_UNAUTHORIZED = previousRejectUnauthorized; - } - stopwatch?.stop(); } } catch (ex) {