First make sure your OpenSSL is working fine, then make sure you've
the SSL headers installed and recompile Ruby. Also, see if the
simplest form of connection works:
I'm assuming that my OpenSSL is working fine and my Ruby is already
compiled with SSL headers, since when I execute using Rails console it
works fine.
Your code doesn't work because this endpoint don't allow http
connection, only https.
If I include the .use_ssl = true in your code, I get the same problem.
When I run this app using WEBrick it also works fine.
This problem only happens on Apache+PhusionPassenger...