Remove deprecated CSR functionality#1507
Open
alex wants to merge 2 commits into
Open
Conversation
Removes OpenSSL.crypto.X509Req, dump_certificate_request, and load_certificate_request, which have been deprecated since 24.2.0. cryptography.x509 should be used instead. https://claude.ai/code/session_01VKp18VRxHchRX2uoj7Ww7m
Also restore the cryptography.utils import, which is needed again by the new dump_privatekey deprecation from main. https://claude.ai/code/session_01VKp18VRxHchRX2uoj7Ww7m
Member
Author
|
Blocked on twisted/twisted#12661 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
CSR support (
X509Req,dump_certificate_request,load_certificate_request) has been deprecated since 24.2.0 — two full major release cycles ago — withDeprecationWarnings pointing users atcryptography.x509.CertificateSigningRequest,load_pem_x509_csr, andload_der_x509_csr. ThecryptographyAPIs are a strict superset of this functionality (and unlikeX509Req, support extensions, modern key types, and a safe immutable API), so there is no capability lost by removing it.This continues the ongoing slimming of
OpenSSL.crypto(following theX509Extensionremoval in 26.2.0, #1376): less deprecated surface to maintain, fewer FFI entry points to audit, and a clearer signal thatpyca/cryptographyis the supported path for X.509 work.Changes
src/OpenSSL/crypto.py: removedX509Req,dump_certificate_request,load_certificate_request, their__all__entries, and the now-unusedcryptography.utilsimporttests/test_crypto.py: removedTestX509Req,test_dump_certificate_request, the CSR PEM fixture, and CSR imports; rewrote thex509_datafixture to set the subject CN directly instead of routing through anX509Reqdoc/api/crypto.rst: dropped the "Certificate signing requests" and "X509Req objects" sectionsCHANGELOG.rst: added an UNRELEASED backward-incompatible entry, matching the format of theX509ExtensionremovalVerification
ruff checkandruff format --checkpassmain(pre-existing noise only; one staletype: ignoredisappeared with the removed code)test_fallback_default_verify_paths) also fails on a clean checkout ofmainin this environment, so it is unrelatedhttps://claude.ai/code/session_01VKp18VRxHchRX2uoj7Ww7m
Generated by Claude Code