From: Eric Wong Date: 2015-07-28T20:10:29+00:00 Subject: [ruby-core:70158] Re: [Ruby trunk - Bug #11400] IO.gets(/\x0d?\x0a\x0d?\x0a/, 4096) raises comparison of Fixnum with nil failed Since you're using SSLSocket, I recommend dumping a backtrace when you rescue since gets is implemented in Ruby in the OpenSSL::Buffering module (ext/openssl/lib/openssl/buffering.rb in the Ruby source)