Skip to content

Instantly share code, notes, and snippets.

@imouaddine
Created July 13, 2018 09:45
Show Gist options
  • Save imouaddine/d885add94a289206c1c4e5a953e37f5a to your computer and use it in GitHub Desktop.
Save imouaddine/d885add94a289206c1c4e5a953e37f5a to your computer and use it in GitHub Desktop.
require "net/http"
uri = URI.parse('https://tlstest.paypal.com')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
begin
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
puts response.body
rescue Errno::ECONNRESET => e
puts "TLS 1.1 is not supported. Please upgrade your integration."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment