Skip to content

Conversation

@moechehabb
Copy link

Fixes "Unable to Connect to Pipecat Cloud API" issue for pcc auth login

  • Add automatic SSL context with certifi fallback for macOS compatibility
  • Add detailed error logging for auth flow failures
  • Add 10-second timeout to prevent indefinite hangs
  • Improve error messages with specific error types (timeout, network, API)
  • Apply SSL fixes to both auth.py and api.py

- Add automatic SSL context with certifi fallback for macOS compatibility
- Add detailed error logging for auth flow failures
- Add 10-second timeout to prevent indefinite hangs
- Improve error messages with specific error types (timeout, network, API)
- Apply SSL fixes to both auth.py and api.py
"""Get SSL context with proper certificate verification.
Attempts to use certifi's certificates as a fallback if system certificates
are not available. This fixes SSL verification issues on macOS and other systems.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more specific about what OS versions of macos this affects?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using Tahoe 26.0 but it can also be tested on different versions to see if can be replicated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @moechehabb ! What Python version are you using? Is it the one from the system or from somewhere else? It's weird that Python doesn't have access to system certificates by default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after a little research, seems this might have to do with how Python was installed on macos (more than OS version).
ie, pyenv / conda, downloaded from python.org vs. homebrew

I might reword it to something like This fixes SSL verification issues encountered by some python installations on macOS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for posterity, claude's debugger script:

import ssl
import certifi
import os

print(f"Default verify paths: {ssl.get_default_verify_paths()}")
print(f"Certifi location: {certifi.where()}")
print(f"SSL version: {ssl.OPENSSL_VERSION}")
print(f"Python executable: {os.path.realpath(sys.executable)}")

@vipyne
Copy link
Member

vipyne commented Oct 15, 2025

There is hesitancy to change this in the code, as it doesn't affect most folks. But it is super helpful for those who do encounter it to be able to quickly address it.

@moechehabb Can you write a troubleshooting section in the Readme about this issue?
Then add to the error message here a link to a Readme section that describes the possible issue (python not finding certs) and how to use certifi to address it.
Feel free to include diagnostic code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants