Skip to content

proxyd: support backend mTLS for websocket upstreams#570

Open
dahu33 wants to merge 2 commits intoethereum-optimism:mainfrom
curvegrid:proxyd-backend-mtls-ws
Open

proxyd: support backend mTLS for websocket upstreams#570
dahu33 wants to merge 2 commits intoethereum-optimism:mainfrom
curvegrid:proxyd-backend-mtls-ws

Conversation

@dahu33
Copy link

@dahu33 dahu33 commented Mar 18, 2026

Summary

This updates proxyd backend TLS handling so the same backend TLS config is applied to both HTTP and WebSocket upstream connections.

It also fixes configureBackendTLS so a backend client certificate/key pair can be used without requiring ca_file to be set. In that case proxyd builds a
default tls.Config and still attaches the configured client certificate for mTLS.

Changes

  • apply backend tls.Config to the outbound WebSocket dialer
  • allow client_cert_file + client_key_file without requiring ca_file
  • add regression tests for:
    • configureBackendTLS with cert-only and CA+cert configurations
    • WithTLSConfig wiring for both HTTP and WebSocket backend clients

Testing

  • go test .
  • go test ./... -run 'TestConfigureBackendTLS|TestWithTLSConfigAppliesToHTTPAndWebsocketClients'

@dahu33 dahu33 requested a review from a team as a code owner March 18, 2026 05:55
@dahu33 dahu33 requested a review from serpixel March 18, 2026 05:55
@wiz-inc-a178a98b5d
Copy link

wiz-inc-a178a98b5d bot commented Mar 18, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 Medium
Software Management Finding Software Management Findings -
Total 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.02%. Comparing base (ed7003d) to head (2b98ddc).

Files with missing lines Patch % Lines
proxyd/proxyd.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #570      +/-   ##
==========================================
+ Coverage   57.83%   58.02%   +0.19%     
==========================================
  Files          96       96              
  Lines       14501    14515      +14     
==========================================
+ Hits         8386     8423      +37     
+ Misses       5597     5570      -27     
- Partials      518      522       +4     
Flag Coverage Δ
proxyd 71.79% <84.21%> (+0.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
proxyd/backend.go 79.82% <100.00%> (+0.55%) ⬆️
proxyd/proxyd.go 56.20% <80.00%> (+1.64%) ⬆️

... and 2 files with indirect coverage changes

🚀 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.

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