Skip to content

fix(mint): wait for the server's SETTINGS frame when connecting - #668

Merged
sleipnir merged 2 commits into
elixir-grpc:masterfrom
arrangabriel:fix/mint-untrusted-cert
Nov 23, 2026
Merged

sleipnir merged 2 commits into
elixir-grpc:masterfrom
arrangabriel:fix/mint-untrusted-cert

Conversation

@arrangabriel

Copy link
Copy Markdown
Contributor

Mint's connect returns once the client side of the TLS handshake is done. With TLS 1.3, the server checks the client certificate after that, so a rejected certificate showed up later as a closed connection, after :connected had already been emitted.

The connection process now reads until the server's first SETTINGS frame arrives, within the transport timeout, before it treats the connection as established. grpc-go does the same (grpc/grpc-go#2406, #5731). A rejection now fails the connect with the TLS alert.

  • The wait matches on %Mint.HTTP2{state: :handshaking} because Mint has no public accessor for it yet. I've proposed Mint.HTTP2.handshaking?/1 upstream and will switch to it once that's released.
  • The second commit changes the default connect timeout from :infinity to 20s, so a server that accepts the connection but never replies can't block the connect forever. It's a separate commit so it's easy to drop if you'd rather keep :infinity.

@sleipnir
sleipnir merged commit 3a2ff8d into elixir-grpc:master Nov 23, 2026
5 checks passed
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.

2 participants