From 59d1f996fa72a6f1f0e24f51468eab14a19e6e41 Mon Sep 17 00:00:00 2001 From: Michael Eklund Date: Fri, 8 Sep 2017 10:32:07 -0500 Subject: [PATCH] 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 --- spec/classes/apt_spec.rb | 4 ++-- templates/proxy.epp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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"; <%- } -%> -- 2.32.3