Skip to content

fix(listener): bump esockd to 5.17.9 - #19600

Merged
zmstone merged 1 commit into
emqx:dev-60from
zmstone:261016-bump-esockd-5179
Oct 16, 2026
Merged

zmstone merged 1 commit into
emqx:dev-60from
zmstone:261016-bump-esockd-5179

Conversation

@zmstone

@zmstone zmstone commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Release version: 6.0.5, 6.1.6, 6.2.4, 6.3.3, 7.0.0
Introduced in: 6.0.0

Summary

Bump esockd from 5.17.7 to 5.17.9 in mix.exs.

5.17.9 — PROXY V2 SSL TLVs take precedence (emqx/esockd#235)

A proxied connection to an SSL listener has two places a client certificate can
come from, and which one holds it depends on where TLS was terminated.

esockd#218 made peercert/1, peer_cert_subject/1 and peer_cert_common_name/1
delegate to the inner ssl_socket unconditionally on an SSL listener, which made
the TLV path unreachable.

Deployment Where the client cert is 5.8 / 5.10 6.0 to 6.3 With this bump
A Passthrough proxy (NLB, Traefik tls: passthrough) + TLS listener, client mTLS to EMQX inner TLS session, no SSL TLVs broken works works
B Proxy terminates mTLS + plain TCP to EMQX + TCP listener PP2 SSL TLVs works works works
C Proxy terminates mTLS + re-encrypt to EMQX + TLS listener, one-way inner PP2 SSL TLVs works broken works
D As C, but the proxy also presents its own cert on the inner hop PP2 SSL TLVs; inner cert is the proxy's works reports the proxy as the client works

Rows C and D are a 5.x to 6.x upgrade regression: 5.8 and 5.10 pin esockd 5.13.0
and 5.14.0, which predate esockd#218, while 6.0 and later pin 5.17.x. Row D does
not fail loudly today.

esockd now reads the SSL TLVs when the header carries certificate information, and
the inner session when it does not. The PROXY header comes from the hop closest to
the client, and enabling proxy_protocol on a listener already declares the
upstream trusted — the peer address comes from the same header. No new
configuration option. peersni/1 follows the same rule for the authority TLV.

5.17.8 — listener socket options

Also included, since this branch is on 5.17.7: correct handling of v6only and
{tune_buffer, false}, rejection of invalid socket tuning options rather than
applying them, and rejection of fragmented PROXY V1 headers.

Verification

mix deps.get resolves esockd 5.17.9 and the fetched tree carries the change.
pre-push-sanity.sh dev-60: ALL SANITY CHECKS PASSED.

Note for the sync chain

dev-63 pins esockd 5.17.8, so the forward sync will conflict on that single line
in mix.exs. Keep 5.17.9.

PR Checklist

  • The changes are covered with new or existing tests
  • Change log for changes visible by users has been added to changes/ee/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • Schema changes are backward compatible or intentionally breaking (describe the changes and the reasoning in the summary)

5.17.9 over the pinned 5.17.7 brings:

* 5.17.9, esockd#235: read the PROXY V2 SSL TLVs ahead of the inner TLS
  session. esockd#218 made the certificate accessors delegate to the
  inner ssl_socket unconditionally on an SSL listener, which made the
  TLV path unreachable. A proxy that terminates mTLS and re-encrypts
  the hop to EMQX then lost the client common name. The header comes
  from the hop closest to the client, so it wins when it carries
  certificate information; the inner session is used when it does not.
  This restores the behaviour of 5.8 and 5.10, which pin esockd 5.13.0
  and 5.14.0 and predate esockd#218.
* 5.17.8: listener socket option fixes for v6only and
  {tune_buffer, false}, rejection of invalid socket tuning options, and
  rejection of fragmented PROXY V1 headers.

Verified with mix deps.get that the tag resolves and the fetched tree
carries the change.
@zmstone
zmstone marked this pull request as ready for review October 16, 2026 08:28
@zmstone
zmstone requested a review from a team as a code owner October 16, 2026 08:28
@zmstone zmstone added the source:customer Reported by, or on behalf of, a customer label Oct 16, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.77%. Comparing base (cca2bcc) to head (fe2b454).
⚠️ Report is 129 commits behind head on dev-60.

Additional details and impacted files
@@            Coverage Diff             @@
##           dev-60   #19600      +/-   ##
==========================================
+ Coverage   85.53%   85.77%   +0.23%     
==========================================
  Files        1175     1175              
  Lines       89514    89995     +481     
==========================================
+ Hits        76570    77194     +624     
+ Misses      12944    12801     -143     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zmstone
zmstone merged commit 5363704 into emqx:dev-60 Oct 16, 2026
166 checks passed
@zmstone
zmstone deleted the 261016-bump-esockd-5179 branch October 16, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source:customer Reported by, or on behalf of, a customer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants