This commit is contained in:
Timothy Jaeryang Baek
2026-04-20 08:34:15 +09:00
parent 51cd43229c
commit fd25152076
8 changed files with 30 additions and 14 deletions
+5 -5
View File
@@ -6,7 +6,7 @@ import aiohttp
from typing import Optional
from open_webui.env import AIOHTTP_CLIENT_TIMEOUT
from open_webui.env import AIOHTTP_CLIENT_SESSION_SSL, AIOHTTP_CLIENT_TIMEOUT
from open_webui.utils.auth import get_admin_user, get_verified_user
from open_webui.config import get_config, save_config, async_save_config
from open_webui.config import BannerModel
@@ -293,7 +293,7 @@ async def verify_terminal_server_connection(
) as session:
# Orchestrators expose a policies API; plain terminals don't.
try:
async with session.get(f'{base_url}/api/v1/policies', headers=headers) as resp:
async with session.get(f'{base_url}/api/v1/policies', headers=headers, ssl=AIOHTTP_CLIENT_SESSION_SSL) as resp:
if resp.ok:
return {'status': True, 'type': 'orchestrator'}
except Exception:
@@ -301,7 +301,7 @@ async def verify_terminal_server_connection(
# Fall back to open-terminal config endpoint.
try:
async with session.get(f'{base_url}/api/config', headers=headers) as resp:
async with session.get(f'{base_url}/api/config', headers=headers, ssl=AIOHTTP_CLIENT_SESSION_SSL) as resp:
if resp.ok:
return {'status': True, 'type': 'terminal'}
except Exception:
@@ -342,7 +342,7 @@ async def put_terminal_server_policy(
timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT),
) as session:
policy_url = f'{base_url}/api/v1/policies/{form_data.policy_id}'
async with session.put(policy_url, headers=headers, json=form_data.policy_data) as resp:
async with session.put(policy_url, headers=headers, json=form_data.policy_data, ssl=AIOHTTP_CLIENT_SESSION_SSL) as resp:
if resp.ok:
return await resp.json()
detail = await resp.text()
@@ -369,7 +369,7 @@ async def verify_tool_servers_config(request: Request, form_data: ToolServerConn
trust_env=True,
timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT),
) as session:
async with session.get(discovery_url) as oauth_server_metadata_response:
async with session.get(discovery_url, ssl=AIOHTTP_CLIENT_SESSION_SSL) as oauth_server_metadata_response:
if oauth_server_metadata_response.status == 200:
try:
oauth_server_metadata = OAuthMetadata.model_validate(