Skip to content

Enabling http2 in HassHttpXAsyncClient breaks aiohttp clients #160074

@richo

Description

@richo

The problem

I have an integration that wants to use http2. I create a client for it using

create_async_httpx_client(hass, http2=True)

But after doing so, I get errors in my logs shaped like:

2025-12-31 12:18:06.120 ERROR (MainThread) [metno] Access to https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned error 'ClientResponseError'

2025-12-31 12:17:54.682 ERROR (MainThread) [homeassistant.components.homeassistant_alerts.coordinator] Error requesting homeassistant_alerts data: 400, message="Expected HTTP/, RTSP/ or ICE/:\n\n  b''\n    ^", url='https://alerts.home-assistant.io/alerts.json'                                           
2025-12-31 12:17:55.109 ERROR (MainThread) [metno] Access to https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned error 'ClientResponseError'

I have tried a little to diagnose what's going on here without a ton of luck, homeassistant_alerts.coordinator uses aiohttp as near as I can tell which makes me very puzzled about why enabling http2 in my integration is breaking it.

What version of Home Assistant Core has the issue?

core-2025.12.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

custom (In my case, franklinwh)

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions