feat(http2): add HTTP/2 client support with TLS 1.3 and ALPN#109
Merged
Conversation
Implement HTTP/2 client for modern web service communication.
Features:
- Full HTTP/2 protocol support (RFC 7540)
- TLS 1.3 with ALPN negotiation ("h2")
- HPACK header compression (RFC 7541)
- Stream multiplexing over single connection
- Flow control with WINDOW_UPDATE frames
- PING/PONG for connection keepalive
- Graceful shutdown with GOAWAY frames
- Async I/O with ASIO
API:
- connect(host, port) - Establish TLS connection with HTTP/2
- get/post/put/del - HTTP methods with response futures
- Configurable timeout and settings
Added:
- include/kcenon/network/protocols/http2/http2_client.h
- src/protocols/http2/http2_client.cpp
- tests/test_http2_client.cpp
Closes #3 (HTTP/2 Client Support)
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
Fix compilation errors when BUILD_WITH_COMMON_SYSTEM is not defined. The error() and error_void() helper functions require individual parameters (code, message, source, details), not a simple_error object. Changes: - Extract error fields before passing to error<T>() in read_frame() - Extract error fields before passing to error<T>() in send_request() - Extract error fields before passing to error_void() in handle_headers_frame()
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
Fix compilation errors in test_http2_client.cpp: - Add namespace alias 'err' for network_system::error_codes to avoid conflict with network_system::protocols::http2::error_code enum - Replace error_codes:: with err:: for all error code references - Fix Result<T> access: use .value() instead of -> operator
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
HTTP/2 client requires TLS for ALPN negotiation with "h2" protocol. Move http2_client.cpp to BUILD_TLS_SUPPORT conditional sources and wrap http2_client tests with the same condition. This fixes build failures on Windows where OpenSSL may not be available in all build configurations.
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
The http2_client.h header includes asio/ssl.hpp which requires OpenSSL headers. Add OpenSSL::SSL and OpenSSL::Crypto to test target link libraries.
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
4 tasks
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
* feat(http2): add HTTP/2 client support with TLS 1.3 and ALPN
Implement HTTP/2 client for modern web service communication.
Features:
- Full HTTP/2 protocol support (RFC 7540)
- TLS 1.3 with ALPN negotiation ("h2")
- HPACK header compression (RFC 7541)
- Stream multiplexing over single connection
- Flow control with WINDOW_UPDATE frames
- PING/PONG for connection keepalive
- Graceful shutdown with GOAWAY frames
- Async I/O with ASIO
API:
- connect(host, port) - Establish TLS connection with HTTP/2
- get/post/put/del - HTTP methods with response futures
- Configurable timeout and settings
Added:
- include/kcenon/network/protocols/http2/http2_client.h
- src/protocols/http2/http2_client.cpp
- tests/test_http2_client.cpp
Closes #3 (HTTP/2 Client Support)
* fix(http2): correct error propagation in http2_client
Fix compilation errors when BUILD_WITH_COMMON_SYSTEM is not defined.
The error() and error_void() helper functions require individual
parameters (code, message, source, details), not a simple_error object.
Changes:
- Extract error fields before passing to error<T>() in read_frame()
- Extract error fields before passing to error<T>() in send_request()
- Extract error fields before passing to error_void() in handle_headers_frame()
* fix(test): resolve namespace conflicts in http2_client tests
Fix compilation errors in test_http2_client.cpp:
- Add namespace alias 'err' for network_system::error_codes to avoid
conflict with network_system::protocols::http2::error_code enum
- Replace error_codes:: with err:: for all error code references
- Fix Result<T> access: use .value() instead of -> operator
* fix(build): make http2_client conditional on BUILD_TLS_SUPPORT
HTTP/2 client requires TLS for ALPN negotiation with "h2" protocol.
Move http2_client.cpp to BUILD_TLS_SUPPORT conditional sources and
wrap http2_client tests with the same condition.
This fixes build failures on Windows where OpenSSL may not be
available in all build configurations.
* fix(test): add OpenSSL link to http2_client_test
The http2_client.h header includes asio/ssl.hpp which requires
OpenSSL headers. Add OpenSSL::SSL and OpenSSL::Crypto to test
target link libraries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Features
API
Files Changed
include/kcenon/network/protocols/http2/http2_client.h- Header filesrc/protocols/http2/http2_client.cpp- Implementationtests/test_http2_client.cpp- Unit testsCMakeLists.txt- Build configurationtests/CMakeLists.txt- Test configurationTODO.md- Mark ticket as completedTest plan