From 1de17d5f0db52d557675242ae1359c39fe306fab Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Tue, 23 Mar 2021 11:54:45 -0400 Subject: [PATCH] Fixes #32180: Unset system proxy and SSL environment variables for the duration of the install Moves from checking for http proxy and SSL environment variables and failing if they are present to a model of unsetting them during the duration of the install run. This does not change them on the system itself. --- checks/env_variables.rb | 9 --------- hooks/boot/05-environment.rb | 5 +++++ 2 files changed, 5 insertions(+), 9 deletions(-) delete mode 100755 checks/env_variables.rb create mode 100644 hooks/boot/05-environment.rb diff --git a/checks/env_variables.rb b/checks/env_variables.rb deleted file mode 100755 index 0004d42e..00000000 --- a/checks/env_variables.rb +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby - -variables = %w[http_proxy https_proxy ssl_cert_file - HTTP_PROXY HTTPS_PROXY SSL_CERT_FILE] - -if variables.map { |variable| ENV[variable] }.compact.any? - $stderr.puts "Please unset the following environment variables before running the installer: #{variables.join(', ')}" - exit 1 -end diff --git a/hooks/boot/05-environment.rb b/hooks/boot/05-environment.rb new file mode 100644 index 00000000..bf8d672e --- /dev/null +++ b/hooks/boot/05-environment.rb @@ -0,0 +1,5 @@ +%w[http_proxy https_proxy ssl_cert_file HTTP_PROXY HTTPS_PROXY SSL_CERT_FILE].each do |variable| + if ::ENV.delete(variable) + logger.warn "Unsetting environment variable '#{variable}' for the duration of the install." + end +end