# Weird Net:HTTP connection issues

**URL:** <https://rubytalk.org/t/weird-net-http-connection-issues/65143>\
**Category:** ruby-talk\
**Created:** [27 March 2012 21:47 UTC](https://rubytalk.org/t/weird-net-http-connection-issues/65143 "2012-03-27T21:47:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [27 March 2012 21:47 UTC](https://rubytalk.org/t/weird-net-http-connection-issues/65143/1 "2012-03-27T21:47:26Z")

</div>

I'm having some new issues connecting to our credit card processors  
servers. I'm working under Linux (dev and production), and have tried  
Ruby 1.8.7, 1.9.2 and 1.9.3 under Linux. This was working for the past  
year, and just recently became a problem.

The weird thing... on Mac OS X, with Ruby 1.8.7 it connects just fine!  
☹

On Linux, when I try to connect to [esqa.moneris.com](http://esqa.moneris.com) it will just timeout  
(or hang forever with Ruby's default Net::HTTP timeout). Even something  
simple like this hangs on my Linux box:

RestClient.get('[https://esqa.moneris.com](https://esqa.moneris.com)')

I can connect to my remote production server without any problem, so  
it's not like Ruby Net::HTTP doesn't work.

Moneris says there's no problem on their end. They had me telnet to  
[esqa.moneris.com](http://esqa.moneris.com), and that did work. Not to mention it works under Mac  
OS X.

Does anyone have any suggestions for debugging this further. I'm sorta  
at a road block. Maybe I just need to sleep on it.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Jeremy\_Bopp](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/jeremy_bopp/32/1937_2.png) [@Jeremy\_Bopp](https://rubytalk.org/u/Jeremy_Bopp)\
**Post date:** [27 March 2012 21:51 UTC](https://rubytalk.org/t/weird-net-http-connection-issues/65143/2 "2012-03-27T21:51:23Z")

</div>

You're using HTTPS there, so could there be some sort of certificate  
issue? Maybe your Linux environments no longer trust the CA cert used  
to sign their certificate. I'm not sure why that would cause an  
apparent hang, but hopefully that helps.

-Jeremy

> **···**
>
> On 03/27/2012 04:47 PM, James E. wrote:
> 
> > I'm having some new issues connecting to our credit card processors  
> > servers. I'm working under Linux (dev and production), and have tried  
> > Ruby 1.8.7, 1.9.2 and 1.9.3 under Linux. This was working for the past  
> > year, and just recently became a problem.
> > 
> > The weird thing... on Mac OS X, with Ruby 1.8.7 it connects just fine!  
> > ☹
> > 
> > On Linux, when I try to connect to esqa.moneris.com it will just timeout  
> > (or hang forever with Ruby's default Net::HTTP timeout). Even something  
> > simple like this hangs on my Linux box:
> > 
> > RestClient.get('[https://esqa.moneris.com](https://esqa.moneris.com)')

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [28 March 2012 00:53 UTC](https://rubytalk.org/t/weird-net-http-connection-issues/65143/3 "2012-03-28T00:53:08Z")

</div>

Hi Jeremy, thanks for the ideas.

I visited [https://esqa.moneris.com/](https://esqa.moneris.com/) in my browser, and it looks like  
they have a valid SSL certificate. I've also tried using  
OpenSSL::SSL::VERIFY\_NONE which also didn't seem to make any difference.  
I enabled debug output for Net:HTTP, but that didn't give much info  
either:

require 'net/http'  
=\> true  
irb(main):003:0\> http = Net::HTTP.new('[esqa.moneris.com](http://esqa.moneris.com)', 443)  
=\> #\<Net::HTTP [esqa.moneris.com:443](http://esqa.moneris.com:443) open=false\>  
irb(main):005:0\> http.use\_ssl = true  
=\> true  
irb(main):006:0\> http.verify\_mode = OpenSSL::SSL::VERIFY\_NONE  
=\> 0  
irb(main):007:0\> http.set\_debug\_output($stdout)  
=\> #\<IO:\<STDOUT\>\>  
irb(main):008:0\> res = http.request(Net::HTTP::Get.new('/'))  
opening connection to [esqa.moneris.com](http://esqa.moneris.com)...  
opened

(sits here...)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [28 March 2012 15:28 UTC](https://rubytalk.org/t/weird-net-http-connection-issues/65143/4 "2012-03-28T15:28:07Z")

</div>

It looks like it may be an OpenSSL 1.0.1 or Arch Linux package issue.  
I've only tested  
under Arch Linux, so I'm not sure if it's just a packaging issue or not?

(worked)  
openssl-1.0.0.f  
openssl-1.0.0.g  
openssl-1.0.0.h

(did not work - timeout)  
openssl-1.0.1-1

I decided to try different OpenSSL versions after testing with  
Python/Requests. The error I got with Python said:

requests.exceptions.SSLError: \_ssl.c:488: The handshake operation timed  
out

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
