Merged the advanced SNI callback implementation with proper µSockets
infrastructure integration. This includes:
- Complete SNI callback bridge with tagged union support
- Integration with µSockets SNI infrastructure from commit 64a409e8
- Enhanced HTTPS server SNICallback routing to TLS servers
- Comprehensive test coverage including regression tests
- All Node.js compatibility features working
The implementation now provides full SNI callback support for dynamic
certificate selection in both TLS and HTTPS servers.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add proper SNI callback bridge with tagged union support
- Integrate with µSockets SNI infrastructure from commit 64a409e8
- Add SNICallback validation and property exposure in TLS servers
- Update setSecureContext to handle SNICallback option
- Add comprehensive test suite for SNI callback functionality
- Begin HTTPS server SNICallback support (needs build completion)
Core functionality working: TLS servers now support dynamic certificate
selection via SNICallback matching Node.js API compatibility.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements SNICallback support for Node.js-compatible TLS servers,
addressing issue #17932.
Changes:
- Add SNICallback field to SSLConfig for parsing JavaScript options
- Update TLS Server to accept and validate SNICallback option
- Add SNI callback bridge function for µSockets integration
- Store SNICallback reference in Listener for later use
- Add comprehensive tests for SNICallback functionality
The implementation provides the foundation for dynamic SNI certificate
selection. The actual µSockets callback integration is prepared but
commented out pending signature resolution.
Note: This implements the JavaScript API layer. The actual SNI callback
invocation will be completed in a follow-up when µSockets signature
issues are resolved.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
### What does this PR do?
<!-- **Please explain what your changes do**, example: -->
<!--
This adds a new flag --bail to bun test. When set, it will stop running
tests after the first failure. This is useful for CI environments where
you want to fail fast.
-->
- [ ] Documentation or TypeScript types (it's okay to leave the rest
blank in this case)
- [x] Code changes
### How did you verify your code works?
Tests added for padding support
Timeout of socket is being fired earlier due to backpressure or lack of
precision in usockets timers (now matchs node.js behavior).
Added check for owner_symbol so the error showed in
https://github.com/oven-sh/bun/issues/21055 is handled
<!-- **For code changes, please include automated tests**. Feel free to
uncomment the line below -->
<!-- I wrote automated tests -->
<!-- If JavaScript/TypeScript modules or builtins changed:
- [ ] I included a test for the new code, or existing tests cover it
- [ ] I ran my tests locally and they pass (`bun-debug test
test-file-name.test`)
-->
<!-- If Zig files changed:
- [ ] I checked the lifetime of memory allocated to verify it's (1)
freed and (2) only freed when it should be
- [ ] I included a test for the new code, or an existing test covers it
- [ ] JSValue used outside of the stack is either wrapped in a
JSC.Strong or is JSValueProtect'ed
- [ ] I wrote TypeScript/JavaScript tests and they pass locally
(`bun-debug test test-file-name.test`)
-->
<!-- If new methods, getters, or setters were added to a publicly
exposed class:
- [ ] I added TypeScript types for the new methods, getters, or setters
-->
<!-- If dependencies in tests changed:
- [ ] I made sure that specific versions of dependencies are used
instead of ranged or tagged versions
-->
<!-- If a new builtin ESM/CJS module was added:
- [ ] I updated Aliases in `module_loader.zig` to include the new module
- [ ] I added a test that imports the module
- [ ] I added a test that require() the module
-->
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>