Skip to content

Instantly share code, notes, and snippets.

@2called-chaos
Created January 5, 2018 16:09
Show Gist options
  • Save 2called-chaos/810009183783743ac23b602437133058 to your computer and use it in GitHub Desktop.
Save 2called-chaos/810009183783743ac23b602437133058 to your computer and use it in GitHub Desktop.
uri = URI.parse "https://acme-v01.api.letsencrypt.org"
http = Net::HTTP.new(uri.hostname, uri.port)
http.use_ssl = true
http.set_debug_output $stderr
req = Net::HTTP::Get.new("/", {'User-Agent' => 'curl/7.47.0'})
response = http.request(req)
[10] pry(main)> response = http.request(req)
opening connection to acme-v01.api.letsencrypt.org:443...
opened
starting SSL for acme-v01.api.letsencrypt.org:443...
SSL established
<- "GET / HTTP/1.1\r\nUser-Agent: curl/7.47.0\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nConnection: close\r\nHost: acme-v01.api.letsencrypt.org\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
...
[8] pry(main)> response = http.request(req);
opening connection to acme-v01.api.letsencrypt.org:443...
Net::OpenTimeout: execution expired
from /opt/rubies/2.3.1/lib/ruby/2.3.0/net/http.rb:880:in `initialize'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment