Skip to content

use http/1.1 ALPN for WSS listener#74

Merged
fabracht merged 2 commits intomainfrom
fix-wss-alpn
Apr 13, 2026
Merged

use http/1.1 ALPN for WSS listener#74
fabracht merged 2 commits intomainfrom
fix-wss-alpn

Conversation

@fabracht
Copy link
Copy Markdown
Contributor

@fabracht fabracht commented Apr 13, 2026

Summary

  • WSS listener was enforcing mqtt ALPN, causing browsers to fail TLS handshake with alert 120 (no application protocol) since they offer h2,http/1.1
  • Changed WSS TlsAcceptorConfig to advertise http/1.1 ALPN instead of mqtt
  • MQTTS listener (port 8883) retains mqtt ALPN unchanged
  • Only http/1.1 is offered (not h2) because the broker doesn't implement RFC 8441 — advertising h2 would break Firefox WebSocket connections
  • Backfilled missing 0.31.3 changelog entry

Test plan

  • test_wss_accepts_http11_alpn — raw TLS handshake with http/1.1 ALPN succeeds
  • test_wss_rejects_mqtt_only_alpnmqtt-only ALPN is rejected (no overlap)
  • test_wss_accepts_browser_alpn — browser-style h2,http/1.1 negotiates http/1.1
  • Existing TLS integration tests pass (5/5)
  • Existing WebSocket integration tests pass (4/4)
  • cargo clippy --all-targets --workspace -- -D warnings -W clippy::pedantic clean
  • Manual: connect to WSS port from a browser

@fabracht fabracht merged commit f31e9bf into main Apr 13, 2026
15 checks passed
@fabracht fabracht deleted the fix-wss-alpn branch April 13, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant