You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add PKCS#12 (.p12) Support in Fetch TLS Options #17543
Currently, Bun's fetch implementation only supports PEM format certificates through the cert and key TLS options. However, many enterprise environments and security systems use PKCS#12 (.p12) certificate files. Users migrating from Node.js, which supports .p12 files via the pfx option in its HTTPS agent, face obstacles when trying to use these certificates in Bun. This forces developers to either convert certificates to PEM format (adding complexity and potential security risks) or maintain separate certificate formats for different environments.
What is the feature you are proposing to solve the problem?
Add support for PKCS#12 (.p12) certificate files in Bun's fetch TLS options, similar to Node.js's pfx option. This would allow users to directly pass .p12 files to the TLS configuration, such as:
awaitfetch(url,{tls: {ca: Bun.file('ca1.pem'),pfx: Bun.file('pfx.p12'),// New proposed optionpassphrase: 'password'}})
What alternatives have you considered?
Converting .p12 files to PEM format before use, but this adds complexity to deployment processes and certificate management.
Using a third-party library to handle the conversion at runtime, but this introduces additional dependencies and potential performance overhead.
Continuing to use Node.js's HTTPS agent for specific endpoints requiring .p12 certificates, but this fragments the codebase and prevents full migration to Bun.
Reacted by Atish Ghimire, Nikita Koynov, Brian Ito, Eugene and uszrkngsdb
Activity
RDBC-1092 Support PKCS#12 client certificates on Bun
uszrkngsdb commentedon Oct 20, 2026
need exactly this today