{"record":{"id":"150c98dec4432eb6","repo":"sqlmapproject/sqlmap","slug":"proxy-closed-connection-during-connect","errorCode":null,"errorMessage":"proxy closed connection during CONNECT","messagePattern":"proxy closed connection during CONNECT","errorType":"exception","errorClass":"H2Error","httpStatus":null,"severity":"error","filePath":"lib/request/http2.py","lineNumber":615,"sourceCode":"    raw = socket.create_connection((proxy_host, proxy_port), timeout=timeout)\n    try:\n        tunnel_host = _format_authority_host(host)\n        authority = \"%s:%d\" % (tunnel_host, port)\n        request = \"CONNECT %s HTTP/1.1\\r\\nHost: %s\\r\\n\" % (authority, authority)\n        if proxy_cred:\n            token = base64.b64encode(_as_bytes(proxy_cred)).decode(\"ascii\")\n            request += \"Proxy-Authorization: Basic %s\\r\\n\" % token\n        request += \"\\r\\n\"\n        raw.sendall(request.encode(\"latin-1\"))\n\n        # Read only through the CONNECT header terminator. A large recv() can consume\n        # bytes from the tunneled TLS handshake that immediately follows the proxy\n        # response, and those bytes cannot be pushed back before wrap_socket().\n        response = bytearray()\n        while not bytes(response).endswith(b\"\\r\\n\\r\\n\"):\n            chunk = raw.recv(1)\n            if not chunk:\n                raise H2Error(\"proxy closed connection during CONNECT\")\n            response.extend(chunk)\n            if len(response) > 65536:\n                raise H2Error(\"oversized proxy CONNECT response\")\n        status_line = bytes(response).split(b\"\\r\\n\", 1)[0].decode(\"latin-1\", \"replace\")\n        fields = status_line.split(None, 2)\n        code = int(fields[1]) if len(fields) >= 2 and fields[1].isdigit() else 0\n        if not 200 <= code < 300:\n            raise H2Error(\"proxy CONNECT failed: %s\" % status_line)\n        return raw\n    except Exception:\n        try:\n            raw.close()\n        except Exception:\n            pass\n        raise\n\n\ndef _make_ssl_context(verify, ssl_context):","sourceCodeStart":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/request/http2.py#L597-L633","documentation":"Error \"proxy closed connection during CONNECT\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/request/http2.py:615 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}