Skip to content

Commit

Permalink
Fixes for use when OpenSSL is not loaded
Browse files Browse the repository at this point in the history
Code in NIO::Monitor and NIO::Selector assumes OpenSSL is loaded, and raises if it isn't.

Fix so OpenSSL isn't required.  User must require it if processing SSLSockets.
  • Loading branch information
MSP-Greg authored and ioquatix committed Jul 4, 2020
1 parent 6c9ec5e commit 6c6bf29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/nio/monitor.rb
Expand Up @@ -8,7 +8,7 @@ class Monitor

# :nodoc:
def initialize(io, interests, selector)
unless io.is_a? OpenSSL::SSL::SSLSocket
unless defined?(::OpenSSL) && io.is_a?(::OpenSSL::SSL::SSLSocket)
unless io.is_a?(IO)
if IO.respond_to? :try_convert
io = IO.try_convert(io)
Expand Down
2 changes: 1 addition & 1 deletion lib/nio/selector.rb
Expand Up @@ -44,7 +44,7 @@ def backend
# * :w - is the IO writeable?
# * :rw - is the IO either readable or writeable?
def register(io, interest)
unless io.is_a? OpenSSL::SSL::SSLSocket
unless defined?(::OpenSSL) && io.is_a?(::OpenSSL::SSL::SSLSocket)
io = IO.try_convert(io)
end

Expand Down

0 comments on commit 6c6bf29

Please sign in to comment.