lib/httpx/io/ssl.rb in httpx-0.18.0 vs lib/httpx/io/ssl.rb in httpx-0.18.1
- old
+ new
@@ -25,9 +25,13 @@
@io.alpn_protocol || super
rescue StandardError
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?
OpenSSL::SSL.verify_certificate_identity(@io.peer_cert, host)