From 07420925524f0ab82d38e96ef57478b2c416701e Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Tue, 27 Oct 2020 14:37:27 +1100 Subject: [PATCH] Fix SSL handling during probe --- src/drivers/npm/driver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index d7888f6fa..ae83bce7d 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -102,7 +102,7 @@ function get(url) { const { get } = url.protocol === 'http:' ? http : https return new Promise((resolve, reject) => - get(url.href, (response) => { + get(url, { rejectUnauthorized: false }, (response) => { if (response.statusCode >= 400) { return reject( new Error(`${response.statusCode} ${response.statusMessage}`) @@ -116,7 +116,7 @@ function get(url) { response.on('data', (data) => (body += data)) response.on('error', (error) => reject(new Error(error.message))) response.on('end', () => resolve(body)) - }) + }).on('error', (error) => reject(new Error(error.message))) ) } else { throw new Error(`Invalid protocol: ${url.protocol}`)