Skip to content

Commit 8797c5d

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 dc8004d commit 8797c5d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/net/imap.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,7 +3750,7 @@ def coerce_search_array_arg_to_seqset?(obj)
37503750
def build_ssl_ctx(ssl)
37513751
if ssl
37523752
params = (Hash.try_convert(ssl) || {}).freeze
3753-
context = SSLContext.new
3753+
context = OpenSSL::SSL::SSLContext.new
37543754
context.set_params(params)
37553755
if defined?(VerifyCallbackProc)
37563756
context.verify_callback = VerifyCallbackProc
@@ -3766,12 +3766,12 @@ def start_tls_session
37663766
raise "SSL extension not installed" unless defined?(OpenSSL::SSL)
37673767
raise "already using SSL" if @sock.kind_of?(OpenSSL::SSL::SSLSocket)
37683768
raise "cannot start TLS without SSLContext" unless ssl_ctx
3769-
@sock = SSLSocket.new(@sock, ssl_ctx)
3769+
@sock = OpenSSL::SSL::SSLSocket.new(@sock, ssl_ctx)
37703770
@reader = ResponseReader.new(self, @sock)
37713771
@sock.sync_close = true
37723772
@sock.hostname = @host if @sock.respond_to? :hostname=
37733773
ssl_socket_connect(@sock, open_timeout)
3774-
if ssl_ctx.verify_mode != VERIFY_NONE
3774+
if ssl_ctx.verify_mode != OpenSSL::SSL::VERIFY_NONE
37753775
@sock.post_connection_check(@host)
37763776
@tls_verified = true
37773777
end

0 commit comments

Comments
 (0)