Skip to content

Bun.serve: require key+cert when a tls object is passed - #35810

Closed
robobun wants to merge 12 commits into
mainfrom
farm/c8181b18/tls-detection-cert-material
Closed

robobun wants to merge 12 commits into
mainfrom
farm/c8181b18/tls-detection-cert-material

[autofix.ci] apply automated fixes

4d7522a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 26, 2026 in 24m 44s

Code review found 2 potential issues

Found 1 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/server/ServerConfig.rs:1441 saw_tls_key gate + tls:[] regresses top-level key/cert from HTTPS to plaintext

Annotations

Check warning on line 1441 in src/runtime/server/ServerConfig.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

saw_tls_key gate + tls:[] regresses top-level key/cert from HTTPS to plaintext

🟡 The new `!saw_tls_key` gate combined with the `len == 0` no-op means `Bun.serve({ tls: [], key: pem, cert: pem, fetch })` regressed from **HTTPS** (the legacy top-level reader used to pick up `key`/`cert`) to **plaintext HTTP** (the reader is now skipped because `saw_tls_key = true`). This is distinct from the existing `tls: []`-alone nit, which correctly noted no behavior change for that case — here a previously-working HTTPS config silently fails open. Calling `require_identity(global, None)