Skip to content

Commit

Permalink
feat(downloader): response http.proxyStrictSSL
Browse files Browse the repository at this point in the history
Closes #1260
  • Loading branch information
fannheyward committed Aug 6, 2024
1 parent 71921db commit 2896868
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/downloader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { exec, spawnSync } from 'node:child_process';
import { type ExtensionContext, window } from 'coc.nvim';
import { type ExtensionContext, window, workspace } from 'coc.nvim';
import { randomBytes } from 'node:crypto';
import { createWriteStream, type PathLike, promises as fs } from 'node:fs';
import { HttpsProxyAgent } from 'https-proxy-agent';
Expand All @@ -11,7 +11,9 @@ import util from 'node:util';
import type { UpdatesChannel } from './config';

const pipeline = util.promisify(stream.pipeline);
const agent = process.env.https_proxy ? new HttpsProxyAgent(process.env.https_proxy as string) : null;
const rejectUnauthorized = workspace.getConfiguration('http').get('proxyStrictSSL', true);
const proxy = process.env.https_proxy || process.env.HTTPS_PROXY;
const agent = proxy ? new HttpsProxyAgent(proxy, { rejectUnauthorized }) : null;

async function patchelf(dest: PathLike): Promise<void> {
const expression = `
Expand Down

0 comments on commit 2896868

Please sign in to comment.