Fix ollama blocking on load_default_certs (#125012)

* Fix ollama blocking on load_default_certs

* Use get_default_context instead of client_context
This commit is contained in:
Richard Kroegel 2024-09-01 17:35:55 +02:00 committed by GitHub
parent 56667ec2bc
commit ef8fc3913e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -33,6 +33,7 @@ from homeassistant.helpers.selector import (
TextSelectorConfig,
TextSelectorType,
)
from homeassistant.util.ssl import get_default_context
from .const import (
CONF_KEEP_ALIVE,
@ -91,7 +92,9 @@ class OllamaConfigFlow(ConfigFlow, domain=DOMAIN):
errors = {}
try:
self.client = ollama.AsyncClient(host=self.url)
self.client = ollama.AsyncClient(
host=self.url, verify=get_default_context()
)
async with asyncio.timeout(DEFAULT_TIMEOUT):
response = await self.client.list()