From: Michael Eklund Date: Fri, 8 Sep 2017 15:32:07 +0000 (-0500) Subject: https proxy bypass fix X-Git-Tag: 4.4.0~7^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=59d1f996fa72a6f1f0e24f51468eab14a19e6e41;p=puppet-modules%2Fpuppetlabs-apt.git https proxy bypass fix * if http proxy is set without an https proxy apt will still attempt to proxy those https sources, resulting in errors. This fix will allow direct connect to the https urls, bypassing the http proxy. This is the most simple fix for this problem, a more complex fix would be to have an https_direct setting. fix test for https proxy bypass --- diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index e743a0d..e46ad05 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -72,7 +72,7 @@ describe 'apt' do is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( /Acquire::http::proxy "http:\/\/localhost:8080\/";/, ).without_content( - %r{Acquire::https::proxy}, + %r{Acquire::https::proxy "DIRECT"}, ) } end @@ -84,7 +84,7 @@ describe 'apt' do is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( /Acquire::http::proxy "http:\/\/localhost:8180\/";/, ).without_content( - %r{Acquire::https::proxy}, + %r{Acquire::https::proxy "DIRECT"}, ) } end diff --git a/templates/proxy.epp b/templates/proxy.epp index 0cbccb8..94e41af 100644 --- a/templates/proxy.epp +++ b/templates/proxy.epp @@ -2,4 +2,6 @@ Acquire::http::proxy "http://<%= $proxies['host'] %>:<%= $proxies['port'] %>/"; <%- if $proxies['https'] { %> Acquire::https::proxy "https://<%= $proxies['host'] %>:<%= $proxies['port'] %>/"; +<%- } else { -%> + Acquire::https::proxy "DIRECT"; <%- } -%>