Skip to content

Support h2c (HTTP/2) for listeners #19322

@schildbach

Description

@schildbach

When a listener's type is http and tls is false, please also support h2c protocol. Currently, only HTTP 1.1 is supported in this case. When trying to connect via HTTP/2, there are errors in the log and the request is ignored.

Client:

# docker compose exec synapse curl --http2-prior-knowledge http://localhost:8008/
curl: (16) Remote peer returned unexpected data while we expected SETTINGS frame.  Perhaps, peer does not support HTTP/2 properly.

Server log:

synapse.http.site - 422 - INFO - sentinel - Connection from IPv6Address(type='TCP', host='::1', port=50648, flowInfo=0, scopeID=0) lost before request headers were read

HTTP/2 is useful for running behind reverse proxies when they commonly terminate the SSL, so the connection from reverse proxy to Synapse is not transport encrypted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions