Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002) #1308

Closed
jambudipa opened this issue Dec 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@jambudipa
Copy link

I could not get the node agent sample working, so decided to try the Python version.

Can't get this working either.

.env.local seems ok, but when running python3 agent.py dev, I get the following error again and again:

2024-12-28 14:29:00,324 - WARNING livekit.agents - failed to connect to livekit, retrying in 0s: Cannot connect to host .livekit.cloud:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)')]

No information in the docs about this.

@jambudipa jambudipa added the bug Something isn't working label Dec 28, 2024
@jambudipa
Copy link
Author

jambudipa commented Dec 28, 2024

I created a minimal Python script to test this conneciton:

import requests
import sys

URL = "https://<my-app>.livekit.cloud"

def main():
    try:
        print(f"Attempting to connect to {URL} ...")
        response = requests.get(URL, timeout=10)
        response.raise_for_status()
        print("Success!")
        print("Response body (first 200 chars):")
        print(response.text[:200])
    except requests.exceptions.RequestException as e:
        print("RequestException (including SSLError):", e)
        sys.exit(1)

if __name__ == "__main__":
    main()

The output suggests it can connect ok:

Attempting to connect to https://<my-app>.livekit.cloud ...
Success!
Response body (first 200 chars):
OK

So what might the problem be?

Certificate appears fine a browser.

@davidzhao
Copy link
Member

your hostname appear to be dropped in the logs, was that redacted intentionally?

Cannot connect to host .livekit.cloud:443

@jambudipa
Copy link
Author

Yes, intentionally.

@davidzhao
Copy link
Member

how are you running this? this error typically shows up when you don't have CA certs installed on the machine. are you on windows?

perhaps this thread would help: https://stackoverflow.com/questions/51925384/unable-to-get-local-issuer-certificate-when-using-requests

@jambudipa
Copy link
Author

I'm sure you're right, but I am not going to investigate. I only looked at Python because I could not get the node working...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants