-
Notifications
You must be signed in to change notification settings - Fork 4
Fix SSL certificate verification and improve auth error handling #93
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
base: main
Are you sure you want to change the base?
Fix SSL certificate verification and improve auth error handling #93
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.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)}")
Co-authored-by: Vanessa Pyne <[email protected]>
Co-authored-by: Vanessa Pyne <[email protected]>
|
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