sqlmapproject/sqlmap · error · H2Error

HTTP/2 requires TLS 1.2 or newer (negotiated %r)

Error message

HTTP/2 requires TLS 1.2 or newer (negotiated %r)

What it means

Guard in the constructor verifying the negotiated TLS version is 1.2 or newer. HTTP/2 requires TLS 1.2+ as a minimum; an older negotiated version (name embedded in the message) means the cipher-suite base is insufficient for h2.

Solutions

  1. Upgrade the server/client to negotiate TLS 1.2 or TLS 1.3
  2. Raise the minimum TLS version in the SSL context configuration
  3. Fall back to HTTP/1.1 if TLS 1.2+ is impossible for this peer
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at lib/request/http2.py:946 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/f9affebf7a45322d. Report an issue: GitHub.

Appendix: source

Thrown at lib/request/http2.py:946

        try:
            try:
                raw.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
            except (OSError, socket.error):
                pass
            self.sock = context.wrap_socket(raw, server_hostname=self.host)
        except Exception:
            try:
                raw.close()
            except Exception:
                pass
            raise
        try:
            selected = getattr(self.sock, "selected_alpn_protocol", lambda: None)()
            if selected != "h2":
                raise H2Error("server did not negotiate h2 (ALPN=%r)" % selected)
            tls_version = getattr(self.sock, "version", lambda: None)()
            if tls_version not in ("TLSv1.2", "TLSv1.3"):
                raise H2Error("HTTP/2 requires TLS 1.2 or newer (negotiated %r)" % tls_version)
            compression = getattr(self.sock, "compression", lambda: None)()
            if compression is not None:
                raise H2Error("TLS compression is not permitted for HTTP/2")
            self.sock.settimeout(timeout)
            settings_payload = struct.pack(
                "!HIHIHI",
                SETTINGS_ENABLE_PUSH, 0,
                SETTINGS_INITIAL_WINDOW_SIZE, LOCAL_INITIAL_WINDOW,
                SETTINGS_MAX_HEADER_LIST_SIZE, MAX_HEADER_LIST_SIZE,
            )
            self.sock.sendall(CONNECTION_PREFACE + encode_frame(SETTINGS, 0, 0, settings_payload))
            self.sock.sendall(encode_frame(
                WINDOW_UPDATE, 0, 0, struct.pack("!I", LOCAL_INITIAL_WINDOW - DEFAULT_WINDOW)
            ))
            self._receive_initial_settings()
        except Exception:
            self.close()
            raise

View on GitHub (pinned to 0a35b20e39)