Add optional HTTP/2 transport via httpx for Tesla SSO and Owner API#177
Open
Bliph wants to merge 1 commit into
Open
Add optional HTTP/2 transport via httpx for Tesla SSO and Owner API#177Bliph wants to merge 1 commit into
Bliph wants to merge 1 commit into
Conversation
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>
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.
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 toTeslaPy itself. Both projects are MIT-licensed.