Skip to content

Commit 2ddbeae

Browse files
authored
Merge pull request #212 from pact-foundation/fix/211_allow-strict-ssl-in-install
fix: set strictSSL on custom downloads from NPM config. Fixes #211
2 parents 977a83d + ae36609 commit 2ddbeae

File tree

3 files changed

+64
-6
lines changed

3 files changed

+64
-6
lines changed

package-lock.json

+57-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"chalk": "2.3.1",
5858
"check-types": "7.3.0",
5959
"cross-spawn": "^7.0.1",
60+
"libnpmconfig": "^1.2.1",
6061
"mkdirp": "0.5.1",
6162
"q": "1.5.1",
6263
"request": "2.87.0",

standalone/install.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import * as Request from 'request';
33
import unzipper = require('unzipper');
44
import tar = require('tar');
55
import pactEnvironment from '../src/pact-environment';
6-
// we have to u se ES6 imports as it's providing correct types for chalk.
6+
// we have to use ES6 imports as it's providing correct types for chalk.
77
import chalk from 'chalk';
8-
98
import path = require('path');
109
import fs = require('fs');
1110
import urljoin = require('url-join');
11+
12+
// eslint-disable-next-line @typescript-eslint/no-var-requires
13+
const config = require('libnpmconfig')
1214
// eslint-disable-next-line @typescript-eslint/no-var-requires
1315
const sumchecker = require('sumchecker');
1416

@@ -157,6 +159,8 @@ function downloadFileRetry(
157159
headers: {
158160
'User-Agent': 'https://github.com/pact-foundation/pact-node',
159161
},
162+
strictSSL: config.read()['strict-ssl'],
163+
ca: config.read()['cafile'],
160164
})
161165
.on('error', (e: string) => reject(e))
162166
.on(

0 commit comments

Comments
 (0)