Skip to content

Commit

Permalink
Merge pull request #37 from jeremymv2/fix_use_ssl_value_changed_error
Browse files Browse the repository at this point in the history
fix: use_ssl value has changed error
  • Loading branch information
alexpop committed Apr 29, 2016
2 parents 1b19dfd + f33a7c1 commit a4b7a28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions libraries/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ class ComplianceProfile < Chef::Resource # rubocop:disable Metrics/ClassLength

tf = Tempfile.new('foo', Dir.tmpdir, 'wb+')
tf.binmode
Net::HTTP.start(url.host, url.port) do |http|
http.use_ssl = url.scheme == 'https'
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # FIXME

opts = { use_ssl: url.scheme == 'https',
verify_mode: OpenSSL::SSL::VERIFY_NONE, # FIXME
}
Net::HTTP.start(url.host, url.port, opts) do |http|
resp = with_http_rescue do
http.get(url.path, 'Authorization' => "Bearer #{token}")
end
Expand Down
8 changes: 4 additions & 4 deletions libraries/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ class ComplianceReport < Chef::Resource
req = Net::HTTP::Post.new(url, { 'Authorization' => "Bearer #{token}" })
req.body = blob.to_json

Net::HTTP.start(url.host, url.port) do |http|
http.use_ssl = url.scheme == 'https'
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # FIXME

opts = { use_ssl: url.scheme == 'https',
verify_mode: OpenSSL::SSL::VERIFY_NONE, # FIXME
}
Net::HTTP.start(url.host, url.port, opts) do |http|
with_http_rescue do
http.request(req)
end
Expand Down

0 comments on commit a4b7a28

Please sign in to comment.