{"message": "failed to connect to livekit, retryin...
# ask-ai
b
{"message": "failed to connect to livekit, retrying in 10s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/connector.py\", line 1283, in _wrap_create_connection\n return await self._loop.create_connection(*args, **kwargs, sock=sock)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/base_events.py\", line 1198, in create_connection\n transport, protocol = await self._create_connection_transport(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n ...<2 lines>...\n ssl_shutdown_timeout=ssl_shutdown_timeout)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/base_events.py\", line 1231, in _create_connection_transport\n await waiter\n File \"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/sslproto.py\", line 581, in _on_handshake_complete\n raise handshake_exc\n File \"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/sslproto.py\", line 563, in _do_handshake\n self._sslobj.do_handshake()\n ~~~~~~~~~~~~~~~~~~~~~~~~~^^\n File \"/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ssl.py\", line 951, in do_handshake\n self._sslobj.do_handshake()\n ~~~~~~~~~~~~~~~~~~~~~~~~~^^\nssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1077)\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/livekit/agents/worker.py\", line 653, in _connection_task\n ws = await self._http_session.ws_connect(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n ...<5 lines>...\n )\n ^\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/client.py\", line 1076, in _ws_connect\n resp = await self.request(\n ^^^^^^^^^^^^^^^^^^^\n ...<11 lines>...\n )\n ^\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/client.py\", line 779, in _request\n resp = await handler(req)\n ^^^^^^^^^^^^^^^^^^\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/client.py\", line 734, in _connect_and_send_request\n conn = await self._connector.connect(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n req, traces=traces, timeout=real_timeout\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n )\n ^\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/connector.py\", line 642, in connect\n proto = await self._create_connection(req, traces, timeout)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/connector.py\", line 1209, in _create_connection\n _, proto = await self._create_direct_connection(req, traces, timeout)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/connector.py\", line 1581, in _create_direct_connection\n raise last_exc\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/connector.py\", line 1550, in _create_direct_connection\n transp, proto = await self._wrap_create_connection(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n ...<7 lines>...\n )\n ^\n File \"/Users/swati/voice_agent/.venv/lib/python3.14/site-packages/aiohttp/connector.py\", line 1285, in _wrap_create_connection\n raise ClientConnectorCertificateError(req.connection_key, exc) from exc\naiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host recivo-52v2q70s.livekit.cloud:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1077)')]", "timestamp": "2025-11-12T075132.282678+00:00"}
t
Thanks for reaching out, Aman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error "SSL: CERTIFICATE_VERIFY_FAILED" usually happens because of some hiccups with SSL/TLS certificate validation. Don’t worry, I’m here to help you through it! Here are some friendly steps to guide you: • First, make sure you’re using SSL certificates signed by a trusted certificate authority. Self-signed certificates won’t work in this case. • If you’re deploying on a VM, try using automated certificate provisioning tools like Caddy. They can easily get certificates from Let’s Encrypt or ZeroSSL. Also, double-check that your domain is correctly pointed to your server’s IP address. • For Kubernetes deployments, you’ll want to import your SSL certificates as Kubernetes Secrets using the
kubectl create secret tls
command. • It’s important to verify that your server is accessible from the internet because obtaining certificates requires external access. Keep an eye on your logs for messages like "certificate obtained successfully." • Give the LiveKit Connection Test utility a try to check your WebSocket connectivity. This can help pinpoint whether the issue is with the network or the certificate itself. If you’d like, I’m here to walk you through any of these steps or answer any questions you have. Just let me know! Sources: Deploy to Kubernetes | LiveKit docs | Diagnosing Connection Errors with Connection Test Utility | Deploying LiveKit | LiveKit docs | Deploy to a VM | LiveKit docs