From f4b00a4576231e51686b225c82b91a667b33337c Mon Sep 17 00:00:00 2001 From: "Schiefelbein, Andrew" Date: Thu, 9 Jul 2020 14:18:57 -0500 Subject: [PATCH] Fix for docker image create behind a proxy with custom CA certs NPM won't honor the system default CA certs, this adds a flag to ask it kidnly to use the system settings instead of the OpenSSL settings it has by default Change-Id: I7e72ff76ee039ebbb268822d34fdef1a473fa8ef --- tools/install_js_linter | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/install_js_linter b/tools/install_js_linter index e093cef..fa00088 100755 --- a/tools/install_js_linter +++ b/tools/install_js_linter @@ -38,6 +38,12 @@ if [[ ! -d $tools_bin_dir/node-$node_version ]]; then # npm requires node to also be on the path export PATH=$(realpath $tools_bin_dir)/node-$node_version/bin:$PATH + # Proxy / SSL issues when using custom CAs with proxy / self signed certs. + # This assumes the system certs are up to date and is on linux or in docker + if [ -r /etc/ssl/certs/ca-certificates.crt ]; then + export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt + fi + # npm will write to a node_modules even with the --directory flag it's better to be in the root of where you want this to live cd web if ! npm install eslint-plugin-html@latest --save-dev; then