diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index f075b893aec..1b94206fbf6 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -324,6 +324,8 @@ def _existing_url(self, url): # Telling curl to fetch the first byte (-r 0-0) is supposed to be # portable. curl_args = ['--stderr', '-', '-s', '-f', '-r', '0-0', url] + if not spack.config.get('config:verify_ssl'): + curl_args.append('-k') _ = curl(*curl_args, fail_on_error=False, output=os.devnull) return curl.returncode == 0