Skip to content

Propagate TLS alert error codes - #528

Open
SC123667 wants to merge 1 commit into
Tencent:developfrom
SC123667:codex/optimize-tls-error-codes-243
Open

Propagate TLS alert error codes#528
SC123667 wants to merge 1 commit into
Tencent:developfrom
SC123667:codex/optimize-tls-error-codes-243

Conversation

@SC123667

Copy link
Copy Markdown

Summary

  • map TLS alert descriptions to QUIC CRYPTO_ERROR codes in the reserved 0x100..=0x1ff range
  • preserve the TLS session's precise close error when propagating handshake failures to the connection
  • extend the ALPN mismatch regression test through both the local close state and the peer's decoded CONNECTION_CLOSE

Root cause

BoringSSL recorded the specific 0x100 + alert code in TlsSessionData, but Connection::process_tls_session never copied it into local_error. The generic receive error path then closed the connection with TlsFail::to_wire(), which fell back to NO_ERROR (0x0).

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all -- -D warnings
  • cargo clippy --all -F ffi -- -D warnings
  • cargo test --verbose (558 unit tests and 1 doc test)
  • cargo build --all -F ffi --verbose
  • cargo test --no-default-features (388 unit tests and 1 doc test)
  • cargo test --no-default-features -F ffi,qlog,h3 (558 unit tests and 1 doc test)
  • typos -c ./typos.toml

Resolve #243

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.

Optimize error code for TLS

1 participant