mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
coalescing: do not try to use a self-signed certificate for coalescing verification purposes
This commit is contained in:
parent
f31b06c150
commit
c7d73d09b8
@ -117,7 +117,8 @@ module HTTPX
|
||||
def coalescable?(connection)
|
||||
if @io.protocol == "h2" &&
|
||||
@origin.scheme == "https" &&
|
||||
connection.origin.scheme == "https"
|
||||
connection.origin.scheme == "https" &&
|
||||
@io.can_verify_peer?
|
||||
@io.verify_hostname(connection.origin.host)
|
||||
else
|
||||
@origin == connection.origin
|
||||
@ -463,6 +464,7 @@ module HTTPX
|
||||
transition(:closing)
|
||||
transition(:closed)
|
||||
emit(:reset)
|
||||
|
||||
@parser.reset if @parser
|
||||
transition(:idle)
|
||||
transition(:open)
|
||||
|
@ -27,6 +27,10 @@ module HTTPX
|
||||
super
|
||||
end
|
||||
|
||||
def can_verify_peer?
|
||||
@ctx.verify_mode == OpenSSL::SSL::VERIFY_PEER
|
||||
end
|
||||
|
||||
def verify_hostname(host)
|
||||
return false if @ctx.verify_mode == OpenSSL::SSL::VERIFY_NONE
|
||||
return false if !@io.respond_to?(:peer_cert) || @io.peer_cert.nil?
|
||||
|
Loading…
x
Reference in New Issue
Block a user