-
Notifications
You must be signed in to change notification settings - Fork 31
Testing: Certificates incompatible with urllib3 2.4.0 and Python 3.13 #708
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 comment by @bdraco (thanks!) also seems relevant in this context:
|
For people using It seems to be revolving around disabling FIPS mode? |
Reading about matters a bit closer 1, I think CA certificates MUST adhere to stronger requirements about their certificates now, like providing Authority Key Identifier and Subject Key Identifier elements. Clients are starting to validate those requirements now, as the error message Footnotes
|
Since I got some messages after being cross-referenced to this, hopefully I can help a bit. To clarify:
IMHO the easiest solutions right now are to either: 1- pin (I discovered the issue so quickly, because CI tests against the default pebble install failed, but ones against my alternate passed) The other ticket cross-referenced is from a tangential issue - verification failed due to a different alignment within the SSL context. The one you're getting hit with is the new requirement of You can also reimplement how the SSL context is created via You could just generate that default context, catch py313 to undo the changes, and pass that context explicitly. I found version pinning to be easiest. IMHO the best solution would be updating the cert and adapting code to enforce the py313 changes on all platforms. That latter bit is a pain. I should file a request against urrlib3 over this. |
Dear @jvanasco. Thank you so much for sharing your excellent elaborations and suggestions. For the sake of completeness: We have been tripped by this beyond the Python driver for the CrateDB database, but also with crate-operator on Python 3.13, that's why I relayed information about how to configure the SSL context for aiohttp: In this case, SSL certificates employed by the AKS K8s HTTP API don't use AKID attributes yet. As we can't do anything about it, we need to apply one of the workarounds as outlined in your suggestions. We summarized them like this:
We may update this statement to also include advises about Within this repository, we will use minica to re-generate testing certificates, as you suggested. Until then, we added a build-time constraint d32b74a to fix the build. We don't expect too many woes on runtime aspects, as we think most of relevant public CA certificates have been upgraded already, so we guess this issue is mostly hitting people who are still using old self-signed certificates. |
I think it is a Python-wide consensus to enforce stronger constraints starting with Python 3.13 only. I am inclined to believe there have been plenty of discussions around this very detail, and I don't disagree too much with that decision. |
Oh gosh, that's messy. Your users are probably getting hit by
AFAIK, in those situations you would need to either pin python under 3.13 OR explicitly create and pass-in a
I agree with you here. There is a slight nuance that may not have been conveyed in my above comment - I intended to address the lack of an easy way to explicitly opt-in earlier Python versions to the new stronger constraints, which was not part of the discussion on this urllib3 change. I just offered to write a PR to accomplish this: the stricter behavior would apply to py>=3.13 OR the presence of an environment variable. |
Thanks. Yeah, with CrateDB Operator talking to AKS, we will stick with using Python 3.12 for now. Others that use urllib3, we will just downgrade to urllib3<2.4. On another detail when sampling other popular HTTP libraries for Python, just looking for "Missing Authority Key Identifier" on the
So it looks like |
Regarding the vanilla Python SSL context, because you referred to ctx = ssl.create_default_context()
ctx.verify_flags = ssl.CERT_REQUIRED |
I am not familiar enough with the current flags to comment on that. I would probably just remove the two new flags, with something like...
Background on the change is here:
In terms of the 5280 stuff:: Of relevance, the py>=3.13 security policy enforces the requirement of AKIDs. The "relax" PR in cryptography just allows for additional fields the CA/B Forum prohibits, but the RFC permits and have been "out in the wild" across trusted root programs for a while. The RFC 5280 stuff is tied to this PR, and basically the inverse of our shared problem :: https://github.com/pyca/cryptography/pull/11462/files |
Problem
urllib3 introduced a slightly breaking change for Python 3.13, which started tripping the test suite on nightly builds.
Details
@jvanasco explains the situation...
Solution
.... and also provides a solution:
Thanks!
References
The text was updated successfully, but these errors were encountered: