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

don't gate the legacy reader off an empty tls array

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

Code review found 1 important issue

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

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/runtime/server/ServerConfig.rs:1384-1385 tls: false regression — removed is_falsey() branch was not dead

Annotations

Check failure on line 1385 in src/runtime/server/ServerConfig.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

tls: false regression — removed is_falsey() branch was not dead

Commit e746f9dd removed `if tls.is_falsey() { args.ssl_config = None }` as "dead", but `get_truthy()` only filters `undefined`/`null`/empty-string — it passes `false`/`0`/`NaN` through — so the branch was live. `Bun.serve({ tls: false, fetch })` (and the common `tls: process.env.USE_TLS && config` idiom) now falls into the single-object arm, where `SSLConfig::from_js` on a boolean primitive throws `"tls" must be an object` instead of serving plaintext HTTP as before. Restore the falsey guard (le