mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
This optimization creates a template X509_STORE once (with all certificates loaded from disk and memory) and then duplicates it for each use. This approach: 1. Calls expensive X509_STORE_set_default_paths() only ONCE 2. Each SSL_CTX gets its own independent store (required for ownership) 3. Custom CA certificates can be added to each store independently 4. Maintains full compatibility with existing TLS behavior The template store is created on first use and cached. Subsequent calls duplicate the certificates from the template, which is much faster than re-parsing from disk. This fixes the test failures in test-tls-client-verify.js while still providing the performance optimization. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>