Skip to content

Add optional HTTP/2 transport via httpx for Tesla SSO and Owner API#177

Open
Bliph wants to merge 1 commit into
tdorssers:masterfrom
Bliph:http2-transport
Open

Add optional HTTP/2 transport via httpx for Tesla SSO and Owner API#177
Bliph wants to merge 1 commit into
tdorssers:masterfrom
Bliph:http2-transport

Conversation

@Bliph

@Bliph Bliph commented Jun 23, 2026

Copy link
Copy Markdown

Since ~June 2026 Tesla's auth.tesla.com and owner-api endpoints require
HTTP/2, which requests (HTTP/1.1) cannot speak, causing token fetch and
refresh to fail with 403 Client Error: forbidden. Use httpx (TLS 1.3 +
ALPN h2) for Owner API calls and token fetch/refresh when available, with
automatic fallback to requests/HTTP/1.1. Follow-up to #176.

Ported from the HTTP/2 fix by Sam Cox (@jasonacox-sam) in
jasonacox/pypowerwall#324 (commit 30c92c3), which applied the same approach
to pypowerwall's vendored copy of TeslaPy. Both projects are MIT-licensed.

Co-authored-by: Sam Cox sam@jasonacox.com

Credit

The HTTP/2 approach here is ported from work by Sam Cox (@jasonacox-sam) in
jasonacox/pypowerwall#324 (merged as jasonacox/pypowerwall@30c92c3), where the
same fix was applied to pypowerwall's vendored copy of TeslaPy
(pypowerwall/cloud/teslapy/__init__.py). This PR upstreams that approach to
TeslaPy itself. Both projects are MIT-licensed.

Since ~June 2026 Tesla's auth.tesla.com and owner-api endpoints require
HTTP/2, which requests (HTTP/1.1) cannot speak, causing token fetch and
refresh to fail with 403 Client Error: forbidden. Use httpx (TLS 1.3 +
ALPN h2) for Owner API calls and token fetch/refresh when available, with
automatic fallback to requests/HTTP/1.1. Follow-up to tdorssers#176.

Ported from the HTTP/2 fix by Sam Cox (@jasonacox-sam) in
jasonacox/pypowerwall#324 (commit 30c92c3), which applied the same approach
to pypowerwall's vendored copy of TeslaPy. Both projects are MIT-licensed.

Co-authored-by: Sam Cox <sam@jasonacox.com>
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