Skip to content

Reimplement REST interface using HTTP/2 #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

frankosterfeld
Copy link
Contributor

Implements a new REST interface using HTTP/2, for lower latency and multiplexing of multiple requests on a single connection.
Instead of multithreading + blocking I/O, where each (long-poll) client occupies a thread, using event-driven non-blocking I/O, and poll() the HTTP-related sockets (server socket and client connections) together with the ZMQ sockets. For that, integrate the server more closely with the Broker.

Did not implement HTTP/3 as part of this, as the QUIC stack adds a lot more complexity (ngtcp2 is very low-level requires a lot of setup and glue code; msquic doesn't seem to allow the integration with the zmq_poll due to abstraction).

@frankosterfeld frankosterfeld changed the title Frank/http2 Reimplement REST interface using HTTP/2 Apr 24, 2025
@wirew0rm wirew0rm linked an issue Apr 24, 2025 that may be closed by this pull request
}

inline std::expected<SSL_CTX_Ptr, std::string> create_ssl_ctx(EVP_PKEY *key, X509 *cert) {
auto ssl_ctx = SSL_CTX_Ptr(SSL_CTX_new(TLS_server_method()), SSL_CTX_free);

Check failure

Code scanning / SonarCloud

Weak SSL/TLS protocols should not be used High

Change this code to use a stronger protocol See more on SonarQube Cloud
Instead of using the httplib-based HTTP server using blocking I/O in
a thread per client, implement a nghttp2-based HTTP/2 server, using
single-threaded non-blocking I/O directly integrated into the Broker
zmq_poll() loop.

Signed-off-by: Frank Osterfeld <[email protected]>
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
33 Security Hotspots
46.5% Coverage on New Code (required ≥ 80%)
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

[10SP] OpenCMW: Rework REST/ZeroMQ interface
1 participant