bimmerconnected / bimmer_connected

🚘 Library to query the status of your BMW or Mini from the ConnectedDrive portal
Apache License 2.0
365 stars 79 forks source link

Allow passing external SSL context #655

Closed rikroe closed 1 month ago

rikroe commented 1 month ago

Proposed change

Allows passing in an external httpx.VerifyType (Union[str, bool, ssl.SSLContext]) via the MyBMWAccount constructor. This is required to stop httpx from loading SSL certificates from disk when initializing a client, as this creates warnings since 2024.9 beta.

2024-09-01 11:35:33.553 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f507d8c46d0>,) inside the event loop by integration 'bmw_connected_drive' at homeassistant/components/bmw_connected_drive/coordinator.py, line 61: await self.account.get_vehicles() (offender: /home/richard/home-assistant-core/venv/lib/python3.12/site-packages/httpx/_config.py, line 147: context.load_verify_locations(cafile=cafile)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+bmw_connected_drive%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations

We're unable to use the HA helper function due to too many adjustments to our client.

Type of change

Additional information

Checklist