diff options
Diffstat (limited to 'ext/openssl/lib/openssl/ssl.rb')
-rw-r--r-- | ext/openssl/lib/openssl/ssl.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb index 9c31fa73cd..7f61fc2a62 100644 --- a/ext/openssl/lib/openssl/ssl.rb +++ b/ext/openssl/lib/openssl/ssl.rb @@ -16,6 +16,7 @@ require "openssl" require "openssl/buffering" +require "fcntl" module OpenSSL module SSL @@ -49,9 +50,18 @@ module OpenSSL end end + module Nonblock + def initialize(*args) + flag = @io.fcntl(Fcntl::F_GETFL) | File::NONBLOCK + @io.fcntl(Fcntl::F_SETFL, flag) + super + end + end + class SSLSocket include Buffering include SocketForwarder + include Nonblock def post_connection_check(hostname) check_common_name = true |