alandtse / tesla

Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Apache License 2.0
601 stars 99 forks source link

Authentication expired #1025

Closed jherby2k closed 3 months ago

jherby2k commented 3 months ago

Is there an existing issue for this?

I have read about the Fleet API and understand I may need to use it

Version of the Tesla component

3.24.0

Version of the Tesla car software

2024.20.9

Model

Model Y

Current Behavior

As of this morning i'm getting "Authentication expired" pop-ups. I've tried re-authenticating with the Tesla HTTP Proxy add-on, pasting in the new generated token (looks like NA_blahblahblah...) as the refresh token as i believe that's what we're using with the fleet API now, right? Anyway, its not working. Tried uninstalling the component and restarting.

I did see some errors in the HTTP proxy logs:

curl: (60) SSL: no alternative certificate subject name matches target host name 'car.chezwhiteherb.ca'
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Warning: Problem (retrying all errors). Will retry in 512 seconds. 5 retries 
Warning: left.

is this because the component tries to use /share/tesla/selfsigned.pem? i'm a bit confused. car.chezwhiteherb.ca has a perfectly valid certificate far as i can see (check yourself: car.chezwhiteherb.ca/.well-known/appspecific/com.tesla.3p.public-key.pem. I tried changing the path in the integration configuration window to my actual wildcard cert from LetsEncrypt, which made that error go away but didn't fix the issue.

Any ideas? I updated the car last night to 2024.20.9 and also updated my router which changed my IPv6 prefix. Don't think either of those would be related, but who knows. This is all getting so very complicated.

Expected Behavior

a working component

Debug logs

Logger: homeassistant.config_entries
Source: config_entries.py:614
First occurred: 11:26:09 AM (2 occurrences)
Last logged: 11:28:19 AM

Config entry 'jeremy.herbison@gmail.com' for tesla_custom integration could not authenticate

Anything else?

No response

jherby2k commented 3 months ago

it was on my end.

If anyone else has this issue - check if you have IPv6 working but not IPv4. In my case the port forwarding to HA stopped working but all my testing checked out over IPv6. Tesla doesn't appear to support IPv6.

Cikkajes commented 3 months ago

I am facing the same issue, but I've never changed my IPv4 IPv6 settings in my FritzBox. It was all working nicely up until a week ago. I have IPv6 enabled, but using natively IPv4 as interface.

So I don't think that's the issue in my case.