-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
Description
What version of Bun is running?
1.3.4
What platform is your computer?
macOS arm64
What steps can reproduce the bug?
Description
When using undici's Agent with the connect.rejectUnauthorized: false option, TLS certificate verification is not bypassed in Bun, but works correctly in Node.js.
Environment
- Bun version: 1.3.4
- Node.js version: 22.21.1 (works correctly)
- undici version: 7.16.0
- OS: macOS arm64
Minimal Reproduction
// minimal-repro.js
import { Agent, request } from 'undici';
const agent = new Agent({
connect: {
rejectUnauthorized: false,
},
});
try {
// Use a public test URL with self-signed certificate
const result = await request('https://self-signed.badssl.com/', {
dispatcher: agent,
method: 'GET',
});
await result.body.text();
console.log('✓ SUCCESS - Status:', result.statusCode);
} catch (err) {
console.log('✗ FAILED -', err.code, ':', err.message);
}Result in Node.js:
✓ SUCCESS - Status: 200
Result in Bun:
✗ FAILED - DEPTH_ZERO_SELF_SIGNED_CERT : self signed certificate
What is the expected behavior?
The rejectUnauthorized: false option should bypass TLS certificate verification in both Node.js and Bun, allowing connections to servers with self-signed or invalid certificates.
What do you see instead?
No response
Additional information

coderabbitai