mirror of
https://github.com/omnara-ai/omnara.git
synced 2025-08-12 20:39:09 +03:00
fix: SSL verification fix asynchttpclient
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
"""Async client for interacting with the Omnara Agent Dashboard API."""
|
||||
|
||||
import asyncio
|
||||
import ssl
|
||||
from typing import Optional, Dict, Any
|
||||
from urllib.parse import urljoin
|
||||
|
||||
import aiohttp
|
||||
import certifi
|
||||
from aiohttp import ClientTimeout
|
||||
|
||||
from .exceptions import AuthenticationError, TimeoutError, APIError
|
||||
@@ -54,8 +56,14 @@ class AsyncOmnaraClient:
|
||||
async def _ensure_session(self):
|
||||
"""Ensure aiohttp session exists."""
|
||||
if self.session is None or self.session.closed:
|
||||
# Create SSL context using certifi's certificate bundle
|
||||
# This fixes SSL verification issues with aiohttp on some systems
|
||||
ssl_context = ssl.create_default_context(cafile=certifi.where())
|
||||
|
||||
self.session = aiohttp.ClientSession(
|
||||
headers=self.headers, timeout=self.timeout
|
||||
headers=self.headers,
|
||||
timeout=self.timeout,
|
||||
connector=aiohttp.TCPConnector(ssl=ssl_context)
|
||||
)
|
||||
|
||||
async def close(self):
|
||||
|
||||
@@ -24,6 +24,7 @@ dependencies = [
|
||||
"requests>=2.25.0",
|
||||
"urllib3>=1.26.0",
|
||||
"aiohttp>=3.8.0",
|
||||
"certifi>=2020.6.20",
|
||||
"fastmcp==2.9.2",
|
||||
"fastapi>=0.100.0",
|
||||
"uvicorn>=0.20.0",
|
||||
|
||||
@@ -37,8 +37,10 @@ def get_client() -> AsyncOmnaraClient:
|
||||
return client
|
||||
|
||||
|
||||
# Create FastMCP server
|
||||
mcp = FastMCP("Omnara Agent Dashboard MCP Server")
|
||||
# Create FastMCP server and metadata
|
||||
mcp = FastMCP(
|
||||
"Omnara Agent Dashboard MCP Server",
|
||||
)
|
||||
|
||||
|
||||
@mcp.tool(name="log_step", description=LOG_STEP_DESCRIPTION)
|
||||
|
||||
Reference in New Issue
Block a user