Skip to content

Commit

Permalink
(CAT-2007) Use vendored cert files and VERIFY_PEER wth NET::HTTP on W…
Browse files Browse the repository at this point in the history
…indows
  • Loading branch information
david22swan committed Sep 18, 2024
1 parent 684600b commit c857683
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/pdk/util/vendored_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ def download_file
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
# TODO: Get rid of this
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if Gem.win_platform?
if Gem.win_platform?
cert_path = 'C:/Program Files/Puppet Labs/DevelopmentKit\ssl\cert.pem'
http.cert = OpenSSL::X509::Certificate.new(cert_path)
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
end
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)

Expand Down

0 comments on commit c857683

Please sign in to comment.