novoc some more, removed unused code

This commit is contained in:
HoneyryderChuck 2019-12-23 11:39:23 +00:00
parent 40e62b590e
commit e03de0d2c6
2 changed files with 4 additions and 8 deletions

View File

@ -4,11 +4,13 @@ require "openssl"
module HTTPX
class SSL < TCP
# :nocov:
TLS_OPTIONS = if OpenSSL::SSL::SSLContext.instance_methods.include?(:alpn_protocols)
{ alpn_protocols: %w[h2 http/1.1] }
else
{}
end
# :nocov:
def initialize(_, _, options)
@ctx = OpenSSL::SSL::SSLContext.new
@ -18,10 +20,6 @@ module HTTPX
@state = :negotiated if @keep_open
end
def scheme
"https"
end
def protocol
@io.alpn_protocol || super
rescue StandardError
@ -116,6 +114,7 @@ module HTTPX
do_transition(nextstate)
end
# :nocov:
def log_transition_state(nextstate)
return super unless nextstate == :negotiated
@ -131,5 +130,6 @@ module HTTPX
" issuer: #{server_cert.issuer}\n" \
" SSL certificate verify ok."
end
# :nocov:
end
end

View File

@ -41,10 +41,6 @@ module HTTPX
@io ||= build_socket
end
def scheme
"http"
end
def to_io
@io.to_io
end