Skip to content

feat(cli): add native HTTPS/TLS and URL scheme parsing support#2373

Open
abn wants to merge 1 commit into
lemonade-sdk:mainfrom
abn:feature/cli-https
Open

feat(cli): add native HTTPS/TLS and URL scheme parsing support#2373
abn wants to merge 1 commit into
lemonade-sdk:mainfrom
abn:feature/cli-https

Conversation

@abn

@abn abn commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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

  • HTTPS/TLS Transport: Integrated OpenSSL (libssl/libcrypto) into the build pipeline and compiled the CLI target with CPPHTTPLIB_OPENSSL_SUPPORT enabled.
  • URL Scheme Parser: Added a portable URL parser (ParseTargetUrl) to strip schemes (https://, http://), clean trailing paths/slashes, and automatically default missing ports (443 for HTTPS, 80 for HTTP) while respecting explicit port overrides.
  • Client Integration: Updated the C++ CLI client constructor and command entry points to dynamically initialize secure or insecure transports, and enabled secure URL browser launching (open_url).
  • Offline-safe Unit Tests: Added automated test coverage (CLIUrlSchemeTests in test/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

  • HTTPS Target: LEMONADE_HOST=https://httpbin.org lemonade list correctly defaults to port 443, resolves the domain, negotiates TLS, and completes the connection.
  • HTTP Target: LEMONADE_HOST=http://httpbin.org lemonade list correctly routes to port 80.
  • Local Fallback: lemonade list without a host successfully preserves the fallback to 127.0.0.1:13305.
  • Automated Suite: PYTHONPATH=test python -m unittest server_cli2.CLIUrlSchemeTests -> PASS (2/2 tests).

@github-actions github-actions Bot added area::cli lemonade CLI client (src/cpp/cli) enhancement New feature or request labels Jun 23, 2026
@abn abn force-pushed the feature/cli-https branch from c8dec34 to d127645 Compare June 23, 2026 19:50
@abn abn force-pushed the feature/cli-https branch from d127645 to c2d0cac Compare June 23, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area::cli lemonade CLI client (src/cpp/cli) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant