From 1765f6c645d2d995ec42187b13a00c9a3d94a718 Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Wed, 26 Feb 2020 18:37:29 +0000 Subject: [PATCH] when using connection coalescing, make sure that, if we're using host certificate verification, that the coalescable connection also wants to use https --- lib/httpx/connection.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/httpx/connection.rb b/lib/httpx/connection.rb index 1a801cf1..6886bd95 100644 --- a/lib/httpx/connection.rb +++ b/lib/httpx/connection.rb @@ -101,7 +101,9 @@ module HTTPX # coalescable connections need to be mergeable! # but internally, #mergeable? is called before #coalescable? def coalescable?(connection) - if @io.protocol == "h2" && @origin.scheme == "https" + if @io.protocol == "h2" && + @origin.scheme == "https" && + connection.origin.scheme == "https" @io.verify_hostname(connection.origin.host) else @origin == connection.origin