-
-
Notifications
You must be signed in to change notification settings - Fork 32k
SSL Cert not being recognized in Python 3.13.x #133564
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
Comments
This is the CPython issue tracker for bugs and features, for support please open a new thread here https://discuss.python.org/c/help/7 please also post tracebacks as text rather than screenshots. I think this is #107361 you will need to pass a custom ssl context without the ssl.VERIFY_X509_STRICT flag ctx = urllib3.util.create_urllib3_context()
ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT
ctx.load_verify_locations(path_to_zscaler_cert) |
EDIT: I made a mistake it is not working. I accidentally ran the code above on Python 3.12 Thanks! @graingert the solution you shared works! Any reason why this is a default behavior now? What should the certificate provider do to comply better to that urllib3 needs? I would like to find a way for Zscaler to provide a long-term solution. I will add tracebacks to the original post. |
remember to use markdown formatting when posting code from terminals: ```pytb Traceback (most recent call last): ... ``` |
I am new to this. I am unable to put the traceback in a collapsible section. It loses the pytb formatting |
We can continue this discussion on the help forums, I don't know the flags needed to fix the cert but perhaps someone on the forums does |
Bug report
Bug description:
EDIT: added Traceback in text form
My organization currently uses Zscaler for security and VPN. On top of that I have no admin rights to my Windows machine.
I have tried a whole host of solutions including one from Anaconda community HERE
What led me to pip-system-certs is this StackOverflow question that is quite similar to my situation HERE
For Python 3.12, I was able to patch the cert by using autowrapt which was kindly provided by pip-system-certs.
Details for this solution and issue documented HERE
I am writing this now is because I have received an official Zscaler certificate from my organization. However, when I proceed to use verify on requests it fails saying "Basic Constraints of CA cert not marked critical" from my understanding all this means is that a cert may be missing an extension CA:TRUE under X509v3 format.
Upon inspection my cert does have X509v3 extensions (see IMAGE 1 below with both cert details and error details)
I have shared my observations to Zscaler as well as of writing this ticket because when Zscaler VPN is off everything runs as per normal.
IMAGE 1
Traceback in text
CPython versions tested on:
3.13
Operating systems tested on:
Windows
The text was updated successfully, but these errors were encountered: