Skip to content

Commit

Permalink
(CAT-2007) Set http_mode to VERIFY_PEER
Browse files Browse the repository at this point in the history
  • Loading branch information
david22swan committed Sep 16, 2024
1 parent afeb5aa commit a7600c2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/pdk/util/vendored_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ 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?
http.ssl_version = :TLSv1_2

Check failure on line 54 in lib/pdk/util/vendored_file.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 2.7) / spec

Naming/VariableNumber: Use normalcase for symbol numbers.

Check failure on line 54 in lib/pdk/util/vendored_file.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 3.2) / spec

Naming/VariableNumber: Use normalcase for symbol numbers.
http.ca_file = @config['ssl-ca-cert']
http.cert = OpenSSL::X509::Certificate.new(ssl_cert)
http.key = OpenSSL::PKey::RSA.new(ssl_key)
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.open_timeout = @config['file-server-conn-timeout']

request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)

Expand Down

0 comments on commit a7600c2

Please sign in to comment.