Skip to content

Commit 981908a

Browse files
committed
♻️ Use full namespace for OpenSSL::SSL constants
These worked because `Net::IMAP` included `OpenSSL::SSL`. But we're going to stop doing that.
1 parent f7d617b commit 981908a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/net/imap.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,7 +3782,7 @@ def coerce_search_array_arg_to_seqset?(obj)
37823782
def build_ssl_ctx(ssl)
37833783
if ssl
37843784
params = (Hash.try_convert(ssl) || {}).freeze
3785-
context = SSLContext.new
3785+
context = OpenSSL::SSL::SSLContext.new
37863786
context.set_params(params)
37873787
if defined?(VerifyCallbackProc)
37883788
context.verify_callback = VerifyCallbackProc
@@ -3798,12 +3798,12 @@ def start_tls_session
37983798
raise "SSL extension not installed" unless defined?(OpenSSL::SSL)
37993799
raise "already using SSL" if @sock.kind_of?(OpenSSL::SSL::SSLSocket)
38003800
raise "cannot start TLS without SSLContext" unless ssl_ctx
3801-
@sock = SSLSocket.new(@sock, ssl_ctx)
3801+
@sock = OpenSSL::SSL::SSLSocket.new(@sock, ssl_ctx)
38023802
@reader = ResponseReader.new(self, @sock)
38033803
@sock.sync_close = true
38043804
@sock.hostname = @host if @sock.respond_to? :hostname=
38053805
ssl_socket_connect(@sock, open_timeout)
3806-
if ssl_ctx.verify_mode != VERIFY_NONE
3806+
if ssl_ctx.verify_mode != OpenSSL::SSL::VERIFY_NONE
38073807
@sock.post_connection_check(@host)
38083808
@tls_verified = true
38093809
end

0 commit comments

Comments
 (0)