Skip to content

Commit 8804470

Browse files
authored
🔀 Merge pull request #533 from ruby/do-not-mixin-openssl-module
💥 Do not mixin `OpenSSL` and `OpenSSL::SSL` modules
2 parents f7d617b + 3bba1c0 commit 8804470

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/net/imap.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -805,10 +805,6 @@ class IMAP < Protocol
805805
autoload :StringPrep, "#{dir}/stringprep"
806806

807807
include MonitorMixin
808-
if defined?(OpenSSL::SSL)
809-
include OpenSSL
810-
include SSL
811-
end
812808

813809
# :call-seq:
814810
# Net::IMAP::SequenceSet(set = nil) -> SequenceSet
@@ -3782,7 +3778,7 @@ def coerce_search_array_arg_to_seqset?(obj)
37823778
def build_ssl_ctx(ssl)
37833779
if ssl
37843780
params = (Hash.try_convert(ssl) || {}).freeze
3785-
context = SSLContext.new
3781+
context = OpenSSL::SSL::SSLContext.new
37863782
context.set_params(params)
37873783
if defined?(VerifyCallbackProc)
37883784
context.verify_callback = VerifyCallbackProc
@@ -3798,12 +3794,12 @@ def start_tls_session
37983794
raise "SSL extension not installed" unless defined?(OpenSSL::SSL)
37993795
raise "already using SSL" if @sock.kind_of?(OpenSSL::SSL::SSLSocket)
38003796
raise "cannot start TLS without SSLContext" unless ssl_ctx
3801-
@sock = SSLSocket.new(@sock, ssl_ctx)
3797+
@sock = OpenSSL::SSL::SSLSocket.new(@sock, ssl_ctx)
38023798
@reader = ResponseReader.new(self, @sock)
38033799
@sock.sync_close = true
38043800
@sock.hostname = @host if @sock.respond_to? :hostname=
38053801
ssl_socket_connect(@sock, open_timeout)
3806-
if ssl_ctx.verify_mode != VERIFY_NONE
3802+
if ssl_ctx.verify_mode != OpenSSL::SSL::VERIFY_NONE
38073803
@sock.post_connection_check(@host)
38083804
@tls_verified = true
38093805
end

0 commit comments

Comments
 (0)