summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSalim Alam <salam@chef.io>2016-03-21 15:52:13 -0700
committerSalim Alam <salam@chef.io>2016-03-21 21:23:08 -0700
commit54934c5101d1c953595d820eb178c8479fdee295 (patch)
treebe13c79f86f35189cbedbab48fbefe0ecae9390b /lib
parent3b500ca0714e95584411c109fd6d4000dee9d50e (diff)
downloadchef-54934c5101d1c953595d820eb178c8479fdee295.tar.gz
Fix proxified socket
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/knife/ssl_check.rb1
-rw-r--r--lib/chef/mixin/proxified_socket.rb8
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