sqlmapproject/sqlmap · error · H2TransportError

connection closed by peer

Error message

connection closed by peer

What it means

Error "connection closed by peer" thrown in sqlmapproject/sqlmap.

Source

Thrown at lib/request/http2.py:541

        out = bytearray()
        for name, value in headers:
            name = _as_bytes(name)
            value = _as_bytes(value)
            out += encode_integer(0, 4, 0x00)
            out += encode_string(name)
            out += encode_string(value)
        return bytes(out)


def _recv_exact(sock, count):
    if count < 0:
        raise ValueError("negative receive size")
    chunks = []
    received = 0
    while received < count:
        chunk = sock.recv(count - received)
        if not chunk:
            raise H2TransportError("connection closed by peer")
        chunks.append(chunk)
        received += len(chunk)
    return b"".join(chunks)


def _read_frame(sock, max_frame_size=DEFAULT_MAX_FRAME_SIZE):
    length, ftype, flags, sid = decode_frame_header(_recv_exact(sock, 9))
    if length > max_frame_size:
        raise H2ProtocolError("received frame exceeds local maximum frame size")
    payload = _recv_exact(sock, length) if length else b""
    return ftype, flags, sid, payload


def _idna_host(host):
    if isinstance(host, bytes):
        try:
            host = host.decode("ascii")
        except UnicodeDecodeError:

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at lib/request/http2.py:541 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/3a1fb642fad2b663. Report an issue: GitHub.