Skip to content

Verify TLS by default with an opt-out - #73

Draft
eliteprox wants to merge 1 commit into
livepeer:mainfrom
eliteprox:feat/opt-out-tls-verification
Draft

eliteprox wants to merge 1 commit into
livepeer:mainfrom
eliteprox:feat/opt-out-tls-verification

Conversation

@eliteprox

Copy link
Copy Markdown
Collaborator

Summary

  • The SDK verifies HTTPS certificates against the system trust store by default, across the shared request helpers (signer, discovery, runners, live payments), the lv2v /payment call, and trickle publish/subscribe.
  • Set LIVEPEER_GATEWAY_VERIFY_TLS=0 (0/false/no/off), or livepeer_gateway.http.VERIFY_TLS = False, to turn verification off for the process when talking to a stock orchestrator that serves a self-signed certificate. The setting is read at call time.
  • The opt-out context is built explicitly (create_default_context() + check_hostname=False + CERT_NONE), matching orch_info.py, instead of the private ssl._create_unverified_context().

Scope

  • The setting is process-wide and all-or-nothing: there is no per-endpoint or per-call override.
  • BYOC is unchanged. #69 removes that client.

Behavior change

Previously the SDK never verified HTTPS certificates. A deployment pointing at a stock self-signed orchestrator must set LIVEPEER_GATEWAY_VERIFY_TLS=0. The gRPC client remains unverified.

Supersedes #72, which was opened from feat/opt-in-tls-verification.

Test plan

  • uv run --frozen --group test pytest tests/test_tls.py — 18 passed
  • ruff check on http.py and tests/test_tls.py
  • Snyk code scan on http.py — no issues
  • Default (verification on): a call to a stock self-signed orchestrator fails certificate verification; a publicly trusted endpoint succeeds
  • With LIVEPEER_GATEWAY_VERIFY_TLS=0: the self-signed orchestrator call succeeds

HTTPS certificates are checked against the system trust store unless
LIVEPEER_GATEWAY_VERIFY_TLS=0. BYOC is unchanged because that client is
removed separately.

This branch has not been deployed

No deployments
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.

1 participant