Problems with Ruby HTTP requests

Hello fellow Rubyists,

I am facing a weird problem that I am not sure is suitable for StackOverflow, so posting here hoping someone has a hint on what’s going on.

Recently I am facing an issue where HTTP requests to a particular URL, using any of Ruby’s HTTP clients, just takes a very long time (> 90 seconds) to complete, and seems to be stuck at best, or raise an SSL related error at worst.

Some points:

  1. This used to work without a problem
  2. The operating system is Ubuntu 18, Ruby version 3.0.1
  3. The same URL works without any problem using curl in the command line, or using a browser.
  4. All other URLs I have tried are working without any issue
  5. I was able to reproduce the problem on another system (also Ubuntu, on Github Actions)
  6. I have tested the site’s SSL certificate in sslshopper.com (report) and it looks ok
  7. I have refreshed the ubuntu root certificates, thinking it may be the problem
  8. This has happened to me in the past, and the problem eventually went away

The simple test code is this:

require 'http'
puts "attempting to download"
url = "https://trade.unionbank.co.il/"
p HTTP.get(url).body.to_s

Any pointer to what can be the cause would be appreciated.