https proxy bypass fix
authorMichael Eklund <meklund@dealnews.com>
Fri, 8 Sep 2017 15:32:07 +0000 (10:32 -0500)
committerWill Meek <william.meek@puppet.com>
Mon, 6 Nov 2017 14:22:44 +0000 (14:22 +0000)
* 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
templates/proxy.epp

index e743a0db67ef99b40f5e13b68f362a0bea030c64..e46ad050728dcb71fb14e490de3384b0981f6686 100644 (file)
@@ -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
index 0cbccb847b46f9337f5214d56bccfd0e50c05f3d..94e41af55d438404e0841871856694fa381abfef 100644 (file)
@@ -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";
 <%- } -%>