Skip to content

Conversation

@stephenberry
Copy link
Owner

@stephenberry stephenberry commented Jan 21, 2026

TLS HTTP Client

Adds SSL/TLS support to the HTTP client, enabling HTTPS requests for both synchronous and asynchronous APIs.

Changes

include/glaze/net/http_client.hpp

  • Introduced socket_variant (std::variant of TCP and SSL socket types) to support both plain and TLS connections throughout the client
  • Added ssl_error enum with std::error_code integration for SSL-specific error reporting (e.g., ssl_not_supported, sni_hostname_failed)
  • Added detail::socket_is_open and detail::close_socket helpers that operate on the socket variant, with optional graceful SSL shutdown (sends close_notify alert)
  • Extended http_connection_pool with SSL context management, is_https connection key discrimination, and thread-safe SSL context access (std::shared_mutex for reader/writer locking)
  • Added SSL handshake flows for both sync and async request paths, including SNI hostname support
  • Added client-facing APIs: set_ssl_verify_mode, configure_ssl_context, set_graceful_ssl_shutdown
  • All SSL functionality is conditionally compiled behind GLZ_ENABLE_SSL

tests/networking_tests/http_client_ssl_test/ (new)

  • Dedicated SSL test suite with self-signed certificate generation at runtime
  • Covers HTTPS GET/POST, certificate verification, SNI, connection pooling over TLS, and error handling for SSL-disabled builds

tests/networking_tests/CMakeLists.txt

  • Added glaze_BUILD_SSL_TESTS option (default ON) to control inclusion of http_client_ssl_test and https_test subdirectories

@packit-as-a-service
Copy link

One of the tests failed for 48f5f37. @admin check logs None, packit dashboard https://dashboard.packit.dev/jobs/copr/3195303 and external service dashboard https://copr.fedorainfracloud.org/coprs/build/10069255/

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.

2 participants