diff options
author | Salim Alam <salam@chef.io> | 2016-03-21 15:52:13 -0700 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2016-03-21 21:23:08 -0700 |
commit | 54934c5101d1c953595d820eb178c8479fdee295 (patch) | |
tree | be13c79f86f35189cbedbab48fbefe0ecae9390b /lib | |
parent | 3b500ca0714e95584411c109fd6d4000dee9d50e (diff) | |
download | chef-54934c5101d1c953595d820eb178c8479fdee295.tar.gz |
Fix proxified socket
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/knife/ssl_check.rb | 1 | ||||
-rw-r--r-- | lib/chef/mixin/proxified_socket.rb | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/knife/ssl_check.rb b/lib/chef/knife/ssl_check.rb index 0995fc8a54..0c672f322e 100644 --- a/lib/chef/knife/ssl_check.rb +++ b/lib/chef/knife/ssl_check.rb @@ -245,6 +245,7 @@ ADVICE def run validate_uri + if verify_X509 && verify_cert && verify_cert_host ui.msg "Successfully verified certificates from `#{host}'" else diff --git a/lib/chef/mixin/proxified_socket.rb b/lib/chef/mixin/proxified_socket.rb index c3b0f7688c..5c9bc3c7d0 100644 --- a/lib/chef/mixin/proxified_socket.rb +++ b/lib/chef/mixin/proxified_socket.rb @@ -16,18 +16,22 @@ # require "proxifier" +require "chef-config/mixin/fuzzy_hostname_matcher" class Chef module Mixin module ProxifiedSocket + include ChefConfig::Mixin::FuzzyHostnameMatcher + # This looks at the environment variables and leverages Proxifier to # make the TCPSocket respect ENV['https_proxy'] or ENV['http_proxy'] if # they are present def proxified_socket(host, port) proxy = ENV["https_proxy"] || ENV["http_proxy"] || false - if proxy - Proxifier.Proxy(proxy, no_proxy: ENV["no_proxy"]).open(host, port) + + if proxy && !fuzzy_hostname_match_any?(host, ENV["no_proxy"]) + Proxifier.Proxy(proxy).open(host, port) else TCPSocket.new(host, port) end |