don't reuse closed connections, refs #4451
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 516d1b2f06..c0901cbe1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -56,6 +56,7 @@ If you depend on these features, please raise your voice in
 * `--modify-headers` now works correctly when modifying a header that is also part of the filter expression (@Prinzhorn)
 * Fix SNI-related reproducibility issues when exporting to curl/httpie commands. (@dkasak)
 * Add option `export_preserve_original_ip` to force exported command to connect to IP from original request. Only supports curl at the moment. (@dkasak)
+* Major proxy protocol testing (@r00t-)
 * --- TODO: add new PRs above this line ---
 * ... and various other fixes, documentation improvements, dependency version bumps, etc.
 
diff --git a/mitmproxy/proxy/layers/http/__init__.py b/mitmproxy/proxy/layers/http/__init__.py
index ba294f0034..76b38e3e95 100644
--- a/mitmproxy/proxy/layers/http/__init__.py
+++ b/mitmproxy/proxy/layers/http/__init__.py
@@ -628,6 +628,7 @@ def get_connection(self, event: GetHttpConnection, *, reuse: bool = True) -> lay
                 h2_to_h1 = self.context.client.alpn == b"h2" and not conn_is_pending_or_h2
                 connection_suitable = (
                     event.connection_spec_matches(connection)
+                    and connection.connected
                     and not h2_to_h1
                 )
                 if connection_suitable:
diff --git a/test/mitmproxy/proxy/layers/http/test_http.py b/test/mitmproxy/proxy/layers/http/test_http.py
index 875d34e39b..c8608e3a10 100644
--- a/test/mitmproxy/proxy/layers/http/test_http.py
+++ b/test/mitmproxy/proxy/layers/http/test_http.py
@@ -969,3 +969,26 @@ def test_upgrade(tctx, proto):
             << Log("Sent HTTP 101 response, but no protocol is enabled to upgrade to.", "warn")
             << CloseConnection(tctx.client)
         )
+
+
+def test_dont_reuse_closed(tctx):
+    """Test that a closed connection is not reused."""
+    server = Placeholder(Server)
+    server2 = Placeholder(Server)
+    assert (
+            Playbook(http.HttpLayer(tctx, HTTPMode.regular), hooks=False)
+            >> DataReceived(tctx.client, b"GET http://example.com/ HTTP/1.1\r\nHost: example.com\r\n\r\n")
+            << OpenConnection(server)
+            >> reply(None)
+            << SendData(server, b"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n")
+            >> DataReceived(server, b"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")
+            << SendData(tctx.client, b"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")
+            >> ConnectionClosed(server)
+            << CloseConnection(server)
+            >> DataReceived(tctx.client, b"GET http://example.com/two HTTP/1.1\r\nHost: example.com\r\n\r\n")
+            << OpenConnection(server2)
+            >> reply(None)
+            << SendData(server2, b"GET /two HTTP/1.1\r\nHost: example.com\r\n\r\n")
+            >> DataReceived(server2, b"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")
+            << SendData(tctx.client, b"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")
+    )
