summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIrving Popovetsky <irving@getchef.com>2015-05-05 11:26:26 -0700
committerIrving Popovetsky <irving@getchef.com>2015-05-05 11:26:26 -0700
commit014113b5c6a8f1650c5968da1385a4ae4237b84e (patch)
tree29a423cc008fa879624d1f405d8b4deb2ec261d7
parent1656fd7b8d34348541311e063192964ac014159d (diff)
downloadchef-014113b5c6a8f1650c5968da1385a4ae4237b84e.tar.gz
Remove now-redundant verify_mode because DefaultSSLPolicy takes care of it for us
-rw-r--r--lib/chef/cookbook_site_streaming_uploader.rb12
-rw-r--r--spec/unit/cookbook_site_streaming_uploader_spec.rb21
2 files changed, 0 insertions, 33 deletions
diff --git a/lib/chef/cookbook_site_streaming_uploader.rb b/lib/chef/cookbook_site_streaming_uploader.rb
index 9961820156..3351eecc52 100644
--- a/lib/chef/cookbook_site_streaming_uploader.rb
+++ b/lib/chef/cookbook_site_streaming_uploader.rb
@@ -145,7 +145,6 @@ class Chef
http = Net::HTTP.new(url.host, url.port)
if url.scheme == "https"
http.use_ssl = true
- http.verify_mode = verify_mode
Chef::HTTP::DefaultSSLPolicy.apply_to(http)
end
res = http.request(req)
@@ -168,17 +167,6 @@ class Chef
res
end
- private
-
- def verify_mode
- verify_mode = Chef::Config[:ssl_verify_mode]
- if verify_mode == :verify_none
- OpenSSL::SSL::VERIFY_NONE
- elsif verify_mode == :verify_peer
- OpenSSL::SSL::VERIFY_PEER
- end
- end
-
end
class StreamPart
diff --git a/spec/unit/cookbook_site_streaming_uploader_spec.rb b/spec/unit/cookbook_site_streaming_uploader_spec.rb
index ef0f649163..0041a142dc 100644
--- a/spec/unit/cookbook_site_streaming_uploader_spec.rb
+++ b/spec/unit/cookbook_site_streaming_uploader_spec.rb
@@ -121,27 +121,6 @@ describe Chef::CookbookSiteStreamingUploader do
})
end
- describe "http verify mode" do
- before do
- @uri = "https://cookbooks.dummy.com/api/v1/cookbooks"
- uri_info = URI.parse(@uri)
- @http = Net::HTTP.new(uri_info.host, uri_info.port)
- expect(Net::HTTP).to receive(:new).with(uri_info.host, uri_info.port).and_return(@http)
- end
-
- it "should be VERIFY_NONE when ssl_verify_mode is :verify_none" do
- Chef::Config[:ssl_verify_mode] = :verify_none
- Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
- expect(@http.verify_mode).to eq(OpenSSL::SSL::VERIFY_NONE)
- end
-
- it "should be VERIFY_PEER when ssl_verify_mode is :verify_peer" do
- Chef::Config[:ssl_verify_mode] = :verify_peer
- Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
- expect(@http.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
- end
- end
-
end # make_request
describe "StreamPart" do