Fix SSL certificate verification and improve auth error handling#93
Fix SSL certificate verification and improve auth error handling#93moechehabb wants to merge 3 commits intodaily-co:mainfrom
Conversation
- 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. |
There was a problem hiding this comment.
Can you be more specific about what OS versions of macos this affects?
There was a problem hiding this comment.
I am using Tahoe 26.0 but it can also be tested on different versions to see if can be replicated.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)}")
Co-authored-by: Vanessa Pyne <vipyne@gmail.com>
Co-authored-by: Vanessa Pyne <vipyne@gmail.com>
|
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? |
Fixes "Unable to Connect to Pipecat Cloud API" issue for pcc auth login