Hyundai-Kia-Connect / kia_uvo

A Home Assistant HACS integration that supports Kia Connect(Uvo) and Hyundai Bluelink. The integration supports the EU, Canada and the USA.
MIT License
417 stars 85 forks source link

CA integration stopped working - SSL error #623

Closed Srkwithlove closed 1 year ago

Srkwithlove commented 1 year ago

Running HA 2023.4.1 Kia integration 2.6.1

Was working fine until last week. Suddenly everything shows up as unavailable. Tried reloading the integration few times but kept getting same error, something about SSL max attempts exceeded, wrong type.(sorry forgot to take screenshot)

Deleted integration, downloaded from HACS again and now unable to add integration. Shows unexpected error while submitting credentials.

Native app and functionality tested and works fine

KIA SORENTO SX 2022 Screenshot_20230408_070703_Home Assistant

olivierjag2 commented 1 year ago

Same with Kia Niro EV

markgreinke commented 1 year ago

Same here but for USA region

cdnninja commented 1 year ago

We need logs for both Canada and USA. I want to confirm this is the same issue.

cdnninja commented 1 year ago

No mention of ssl. Please open a new issue. We will keep this thread focused on Canada ssl. Each api is separate.

markgreinke commented 1 year ago

No mention of ssl. Please open a new issue. We will keep this thread focused on Canada ssl. Each api is separate.

Deleted USA SSL issue report..Turns out scheduled maintenance is underway right now.

MountainGod2 commented 1 year ago

We need logs for both Canada and USA. I want to confirm this is the same issue.

Hope this helps:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/config/custom_components/kia_uvo/services.py", line 49, in async_handle_force_update
    await coordinator.async_force_update_all()
  File "/config/custom_components/kia_uvo/coordinator.py", line 158, in async_force_update_all
    await self.async_check_and_refresh_token()
  File "/config/custom_components/kia_uvo/coordinator.py", line 166, in async_check_and_refresh_token
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 121, in check_and_refresh_token
    self.token: Token = self.api.login(self.username, self.password)
  File "/usr/local/lib/python3.10/site-packages/hyundai_kia_connect_api/KiaUvoApiCA.py", line 124, in login
    response = self.sessions.post(url, json=data, headers=headers)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 635, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 723, in send
    history = [resp for resp in gen]
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 723, in <listcomp>
    history = [resp for resp in gen]
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 266, in resolve_redirects
    resp = self.send(
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 563, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='kiaconnect.ca', port=443): Max retries exceeded with url: /tods/api/lgn (Caused by SSLError(SSLError(1, '[SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)')))
domarseneault commented 1 year ago

Same issue. Started april 7 at 2:12 am for me.

cdnninja commented 1 year ago

I am seeing same thing now. I will spend some time on this soon.

Yanom1212 commented 1 year ago

same here: Capture d’écran 2023-04-09 111139

stuartmayor commented 1 year ago

~~Same issue with Hyundai EU. I had all sensors unavailable, and tried removing and re-adding the integration. I now just get "Unexpected Error" at this point~~

Scratch that. The update to 2.8.0 has fixed the problem. Thank you for your work!

hexonMD commented 1 year ago

Still not working for me.


Logger: custom_components.kia_uvo.config_flow
Source: custom_components/kia_uvo/config_flow.py:63
Integration: Hyundai / Kia Connect (documentation, issues)
First occurred: 12:05:27 PM (1 occurrences)
Last logged: 12:05:27 PM

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 419, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/local/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/usr/local/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='kiaconnect.ca', port=443): Max retries exceeded with url: /tods/api/lgn (Caused by SSLError(SSLError(1, '[SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/kia_uvo/config_flow.py", line 159, in async_step_user
    await validate_input(self.hass, user_input)
  File "/config/custom_components/kia_uvo/config_flow.py", line 63, in validate_input
    token: Token = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/hyundai_kia_connect_api/KiaUvoApiCA.py", line 124, in login
    response = self.sessions.post(url, json=data, headers=headers)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 635, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 723, in send
    history = [resp for resp in gen]
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 723, in <listcomp>
    history = [resp for resp in gen]
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 266, in resolve_redirects
    resp = self.send(
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 563, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='kiaconnect.ca', port=443): Max retries exceeded with url: /tods/api/lgn (Caused by SSLError(SSLError(1, '[SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)')))
cdnninja commented 1 year ago

Give the latest a try.

domarseneault commented 1 year ago

The integration loaded after updating. But a bunch of the sensors don't show up anymore. I don't see anything to do with EV battery, or range

domarseneault commented 1 year ago

Nevermind! I deleted and re added it and it worked great and now I have the option to change charge limits. Thank you for the hard work on this

keithajmani commented 1 year ago

Same error, not working for me, even after removing and re-adding the integration and restarting home assistant.

domarseneault commented 1 year ago

I had to delete and update the repository itself in HACS, not just the integration

On Sun, Apr 9, 2023, 7:47 p.m. keithajmani @.***> wrote:

Same error, not working for me, even after removing and re-adding the integration and restarting home assistant.

— Reply to this email directly, view it on GitHub https://github.com/Hyundai-Kia-Connect/kia_uvo/issues/623#issuecomment-1501240006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZTFDGMQQ4UHXSRKRP2ZUKDXANC7XANCNFSM6AAAAAAWXMTD5U . You are receiving this because you commented.Message ID: @.***>

keithajmani commented 1 year ago

OK — I applied the fix committed after the last release, and it works! All I did was edit the configuration file myself, under HA/config/custom_components/kia_uvo/manifest.json

https://github.com/Hyundai-Kia-Connect/kia_uvo/compare/v2.8.0...master

Change

"requirements": ["hyundai_kia_connect_api==3.1.7"],

TO

"requirements": ["hyundai_kia_connect_api==3.1.9"],

Srkwithlove commented 1 year ago

I can confirm the new update v2.8.1 has resolved the issue.

Thank you!