Skip to content

Commit 3cea84f

Browse files
pollendMichael Pollinddjelinek
authored
feat: allow download to disable TLS check env flag (#1857)
Signed-off-by: Michael Pollind <[email protected]> Co-authored-by: Michael Pollind <[email protected]> Co-authored-by: Dominik Jelínek <[email protected]>
1 parent 1c718cb commit 3cea84f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/Test-Setup.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ The ExTester offers both CLI and API to perform all the setup actions. That way
1414
export TEST_RESOURCES="./test-folder"
1515
```
1616

17+
- `HTTP_PROXY` - can be used to route http request over a prox for downloading VSCode and Chromium driver.
18+
- `EXTENSIONS_FOLDER` - configuring the [extension path](https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_where-are-extensions-installed) where extensions are installed/loaded.
19+
- `EXTENSION_DEV_PATH` - The [developer extension](https://vscode-docs.readthedocs.io/en/stable/extensions/debugging-extensions/) that is loaded under development.
20+
- `HTTPS_TLS_REJECT_UNAUTHORIZED ` - Disable TLS check when downloading VSCode and Chromium driver. '0' is disabled and '1' is enabled, this setting aligns with [`NODE_TLS_REJECT_UNAUTHORIZED`](https://nodejs.org/api/cli.html#node_tls_reject_unauthorizedvalue).
21+
22+
```shell
23+
export HTTPS_TLS_REJECT_UNAUTHORIZED="0"
24+
```
25+
1726
## Using the CLI
1827

1928
All the CLI actions are available with the command `extest` which is available to your npm scripts once the package is installed. The default storage folder for all test resources is a `$TMPDIR/test-resources`.

packages/extester/src/util/download.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ const httpProxyAgent = !process.env.HTTP_PROXY
2727
proxy: process.env.HTTP_PROXY,
2828
});
2929

30+
const rejectUnauthorized = +(process.env.HTTPS_TLS_REJECT_UNAUTHORIZED ?? 1) >= 1;
3031
const httpsProxyAgent = !process.env.HTTPS_PROXY
3132
? undefined
3233
: new HttpsProxyAgent({
3334
proxy: process.env.HTTPS_PROXY,
3435
});
3536

3637
const options = {
38+
https: {
39+
rejectUnauthorized,
40+
},
3741
headers: {
3842
'user-agent': 'nodejs',
3943
},

0 commit comments

Comments
 (0)