Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http proxy bypass #718

Merged
merged 2 commits into from
Nov 8, 2017
Merged

Http proxy bypass #718

merged 2 commits into from
Nov 8, 2017

Conversation

willmeek
Copy link

@willmeek willmeek commented Nov 6, 2017

This PR builds on #699

Rather than always defaulting the https proxy to 'DIRECT', use another proxy setting to determine whether this should be the case.

* 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
@@ -84,7 +84,7 @@
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},
/Acquire::https::proxy/,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should still be the %r{ }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all regexes to use %r notation

@@ -72,7 +72,7 @@
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},
/Acquire::https::proxy/,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should still be the %r{ }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all regexes to use %r notation

@tphoney
Copy link

tphoney commented Nov 6, 2017

Otherwise looks good !!

@eputnam
Copy link

eputnam commented Nov 7, 2017

Would you mind throwing a little blurb about it here? https://github.com/puppetlabs/puppetlabs-apt/blame/master/README.md#L284 I had to use git blame to get a stupid line number.

This commit adds a 'direct' boolean option to proxy settings.
When set to true, if https is not true, the https proxy is set
to 'DIRECT'.
@willmeek
Copy link
Author

willmeek commented Nov 8, 2017

@eputnam Thanks Eric, great suggestion, updated with the new setting.

@eputnam eputnam removed the needs-docs label Nov 8, 2017
@eputnam eputnam merged commit 45a3ce3 into puppetlabs:master Nov 8, 2017
@eputnam eputnam added the feature label Nov 8, 2017
@eputnam eputnam mentioned this pull request Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants