Skip to content

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

Closed
eliteprox wants to merge 4 commits into
livepeer:mainfrom
eliteprox:feat/opt-in-tls-verification
Closed

eliteprox wants to merge 4 commits into
livepeer:mainfrom
eliteprox:feat/opt-in-tls-verification

Conversation

@eliteprox

@eliteprox eliteprox commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The SDK now 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. Documented in the README and the _ssl_context docstring.
  • BYOC is out of scope. byoc.py is left unchanged here, since Remove BYOC inference and training jobs #69 removes the BYOC client entirely.

Behavior change

Previously the SDK never verified HTTPS certificates. With verification now on by default, a deployment pointing at a stock self-signed orchestrator must set LIVEPEER_GATEWAY_VERIFY_TLS=0. The gRPC client remains unverified.

Test plan

  • uv run --frozen --group test pytest — 262 passed, including tests/test_tls.py
  • ruff check on http.py and tests/test_tls.py
  • Snyk code scan on http.py — no issues (the prior no-hostname-verification finding is resolved)
  • 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

eliteprox and others added 2 commits October 5, 2026 15:52
LIVEPEER_GATEWAY_VERIFY_TLS=1, or livepeer_gateway.http.VERIFY_TLS = True,
verifies HTTPS certificates against the system trust store on every HTTP call
the SDK makes: the shared request helpers (signer, discovery, runners, live
payments), BYOC, the lv2v /payment call, and trickle publish/subscribe. The
setting is read at call time and both SSL contexts are built once.

The default is unchanged. Orchestrators serve self-signed certificates and
go-livepeer itself skips verification for orchestrator-facing calls, so
verifying by default would break runner calls, BYOC, payments and trickle
against stock orchestrators.

Split from BlueClawNetwork#1, without per-call
verify_tls arguments.

Co-authored-by: Mike Zupper <me@mikezupper.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generate a throwaway self-signed certificate in the TLS tests instead of committing the fixture certificate and key.
@eliteprox
eliteprox requested a review from j0sh as a code owner October 9, 2026 18:45
Default to verifying HTTPS certificates against the system trust store;
LIVEPEER_GATEWAY_VERIFY_TLS=0 (or http.VERIFY_TLS=False) turns it off for
self-signed orchestrators. Build the opt-out context explicitly instead of
the private ssl._create_unverified_context(), matching orch_info.py and
clearing the Snyk no-hostname-verification finding.

Revert byoc.py: those TLS changes are out of scope since livepeer#69 removes the
BYOC client. Document the process-wide, all-or-nothing scope.
@eliteprox eliteprox changed the title Add opt-in TLS certificate verification Verify TLS by default with an opt-out Oct 9, 2026
@eliteprox eliteprox mentioned this pull request Oct 9, 2026
3 of 5 tasks
@eliteprox

Copy link
Copy Markdown
Collaborator Author

Superseded by #73 on feat/opt-out-tls-verification, as a single commit. The branch name now matches verify-by-default with an opt-out.

@eliteprox eliteprox closed this Oct 9, 2026
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