Skip to content

Add native macOS TLS client and server support with Network.framework - #615

Merged
bsergean merged 3 commits into
masterfrom
feature/network-framework-tls
Oct 14, 2026
Merged

bsergean merged 3 commits into
masterfrom
feature/network-framework-tls

Conversation

@bsergean

Copy link
Copy Markdown
Collaborator

Add an opt-in Network.framework backend so macOS WebSocket and HTTP clients and servers can use native TLS 1.2/1.3 without linking OpenSSL. The existing Secure Transport backend has no server support; this adds a native listener, mutual TLS, Apple certificate trust evaluation, and bounded asynchronous I/O integrated with the existing polling loop.

Enable it with make -f makefile.dev ws_network_framework. This rebuilds build/ws/ws, overriding cached TLS backend selections. make -f makefile.dev test_network_framework builds and runs the native TLS integration tests. The backend currently requires macOS 10.15+; custom cipher strings and adoption of existing BSD sockets are explicitly unsupported.

Align the runtime version header with the latest published release, v12.0.1, and the existing CMake project version. The branch includes current master through ae091a9.

Validation on macOS 26.4:

  • Native TLS integration tests pass: WebSocket echo, 256 KiB HTTP transfers, IPv4/IPv6/DNS hostname checks, PEM chains and custom CAs, mutual TLS, invalid/expired certificates, cancellation, and server shutdown during a stalled handshake.
  • AddressSanitizer and UndefinedBehaviorSanitizer integration tests pass.
  • Independent Python TLS peers confirm TLS 1.3 interoperability in both client and server roles.
  • Static/shared builds and an installed CMake consumer pass; otool -L confirms no OpenSSL library linkage.
  • After merging master, the full suite passes 17/19 tests. IXSocketConnectTest and IXDNSLookupTest also fail in a TLS-disabled baseline because the local DNS environment resolves the tests' presumed nonexistent names.
  • ./build/ws/ws --version reports ws ixwebsocket/12.0.1 macos ssl/Network.framework zlib 1.2.12.

The openssl command-line tool is used only to generate temporary test credentials; no system keychain changes are made.

@bsergean
bsergean merged commit c502fa3 into master Oct 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant