feat(cli): add native HTTPS/TLS and URL scheme parsing support#2373
Open
abn wants to merge 1 commit into
Open
Conversation
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.
This PR adds native HTTPS/TLS negotiation and URL scheme parsing to the C++ CLI client (
lemonade). This allows the CLI to seamlessly connect to secure remote endpoints (e.g., platforms like Modal, Cloudflare tunnels, or reverse proxies) equivalent to the desktop client.Key Changes
libssl/libcrypto) into the build pipeline and compiled the CLI target withCPPHTTPLIB_OPENSSL_SUPPORTenabled.ParseTargetUrl) to strip schemes (https://,http://), clean trailing paths/slashes, and automatically default missing ports (443for HTTPS,80for HTTP) while respecting explicit port overrides.open_url).CLIUrlSchemeTestsintest/server_cli2.py) using a local mock HTTP server on an ephemeral port. This verifies HTTP/HTTPS routing and TLS handshake attempts deterministically without relying on external internet access.Verification
LEMONADE_HOST=https://httpbin.org lemonade listcorrectly defaults to port 443, resolves the domain, negotiates TLS, and completes the connection.LEMONADE_HOST=http://httpbin.org lemonade listcorrectly routes to port 80.lemonade listwithout a host successfully preserves the fallback to127.0.0.1:13305.PYTHONPATH=test python -m unittest server_cli2.CLIUrlSchemeTests-> PASS (2/2 tests).