Skip to content

Commit 2cf7c7e

Browse files
Merge pull request #1396 from puppetlabs/CAT-2007-2
(CAT-2007) Use vendored cert files and VERIFY_PEER wth NET::HTTP on Windows
2 parents 684600b + c857683 commit 2cf7c7e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/pdk/util/vendored_file.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ def download_file
5151
uri = URI.parse(url)
5252
http = Net::HTTP.new(uri.host, uri.port)
5353
http.use_ssl = true
54-
# TODO: Get rid of this
55-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if Gem.win_platform?
54+
if Gem.win_platform?
55+
cert_path = 'C:/Program Files/Puppet Labs/DevelopmentKit\ssl\cert.pem'
56+
http.cert = OpenSSL::X509::Certificate.new(cert_path)
57+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
58+
end
5659
request = Net::HTTP::Get.new(uri.request_uri)
5760
response = http.request(request)
5861

0 commit comments

Comments
 (0)