bimmer_connected icon indicating copy to clipboard operation
bimmer_connected copied to clipboard

bmw_connected_drive "verify failed" and "Error handling request"

Open mjxoicq opened this issue 2 years ago • 2 comments

Describe the issue

Firstly, the integration didn't work and showed the following error:

  • [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

Then I deleted the integration and tried to add it again, it showed another error(Log can be found in the following content): image

I checked my bmw app, it works fine. And my password is correct.

Logger: aiohttp.server Source: custom_components/bmw_connected_drive/config_flow.py:42 Integration: bmw_connected_drive First occurred: 17:18:18 (1 occurrences) Last logged: 17:18:18

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/bmw_connected_drive/config_flow.py", line 68, in async_step_user info = await validate_input(self.hass, user_input) File "/config/custom_components/bmw_connected_drive/config_flow.py", line 42, in validate_input await account.get_vehicles() File "/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py", line 70, in get_vehicles vehicles_responses: List[httpx.Response] = [ File "/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py", line 71, in await client.get( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1736, in get return await self.request( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1513, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1600, in send response = await self._send_handling_auth( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1625, in _send_handling_auth request = await auth_flow.anext() File "/usr/local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 76, in async_auth_flow await self.login() File "/usr/local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 119, in login token_data = await self._login_china() File "/usr/local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 260, in _login_china response = await client.get( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1736, in get return await self.request( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1513, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1600, in send response = await self._send_handling_auth( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1628, in _send_handling_auth response = await self._send_handling_redirects( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1665, in _send_handling_redirects response = await self._send_single_request(request) File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1702, in _send_single_request response = await transport.handle_async_request(request) File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 291, in handle_async_request resp = await self._pool.handle_async_request(req) File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 248, in handle_async_request raise exc File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 232, in handle_async_request response = await connection.handle_async_request(request) File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request raise exc File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 67, in handle_async_request stream = await self._connect(request) File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 146, in _connect stream = await stream.start_tls(**kwargs) File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 62, in start_tls ssl_stream = await anyio.streams.tls.TLSStream.wrap( File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 94, in wrap await wrapper._call_sslobject_method(ssl_object.do_handshake) File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 102, in _call_sslobject_method result = func(*args) File "/usr/local/lib/python3.9/ssl.py", line 944, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

mjxoicq avatar Jul 04 '22 09:07 mjxoicq

This looks like it is not an issue with the library itself, but rather your system or an issue on BMW side regarding SSL certificates. Are you using a proxy/VPN of some sorts between Home Assistant and the internet?

Otherwise it could be an indication that somebody is trying to listen to you HTTP traffic, but then it should occur on all HA integrations that use data from the internet (such as weather services etc).

rikroe avatar Jul 09 '22 08:07 rikroe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 08 '22 03:10 github-actions[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 15 '22 03:11 github-actions[bot]