Conversation
The SSL docs advertise FILETYPE_ASN1 for use_certificate_file and use_privatekey_file, but only FILETYPE_PEM was imported from crypto. Re-export both constants via SSL.__all__ and cover with a regression test. Fixes pyca#1217
|
Ok
Lynda Escobar
El El mié, 30 de sep de 2026 a la(s) 4:47 a.m., 00200200 <
***@***.***> escribió:
… Summary
Fixes #1217 <#1217>.
OpenSSL.SSL documentation lists FILETYPE_ASN1 for
Context.use_certificate_file / use_privatekey_file, but the module only
imported FILETYPE_PEM from OpenSSL.crypto. Accessing
OpenSSL.SSL.FILETYPE_ASN1 raised AttributeError.
This PR re-exports FILETYPE_ASN1 (and adds both file-type constants to
SSL.__all__) so the public SSL API matches the docs and the existing
crypto constants.
Test plan
- tests/test_ssl.py::TestConstants::test_filetype_asn1 fails on main (
ImportError / missing attribute) and passes with this change
- TestConstants (13 tests) pass locally
- ruff check / ruff format --check clean on touched Python files
------------------------------
You can view, comment on, or merge this pull request online at:
#1536
Commit Summary
- 751dea9
<751dea9>
Export OpenSSL.SSL.FILETYPE_ASN1 to match documented API
File Changes
(3 files <https://github.com/pyca/pyopenssl/pull/1536/files>)
- *M* CHANGELOG.rst
<https://github.com/pyca/pyopenssl/pull/1536/files#diff-2c623f3c6a917be56c59d43279244996836262cb1e12d9d0786c9c49eef6b43c>
(3)
- *M* src/OpenSSL/SSL.py
<https://github.com/pyca/pyopenssl/pull/1536/files#diff-a356695ef2f2ac188025345e13495b97ad1b4d991bf8f913e42aa86c841397b5>
(3)
- *M* tests/test_ssl.py
<https://github.com/pyca/pyopenssl/pull/1536/files#diff-5fbedfbbf8f0780aeee680927973f302330dc10fe915c7e7deecf4b0556c492c>
(14)
Patch Links:
- https://github.com/pyca/pyopenssl/pull/1536.patch
- https://github.com/pyca/pyopenssl/pull/1536.diff
—
Reply to this email directly, view it on GitHub
<#1536?email_source=notifications&email_token=A6JCW34DZXVVAK5A4EDZYXD5RTQFNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DMOBZGQ2DGNBRHCTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6JCW35AFF2P7ZA75Q3U7NT5RTQFNAVCNFSNUABEKJSXA33TNF2G64TZHMYTKNZXHAYDKOJ3JFZXG5LFHM2TMNBVGIZDONRXG2QXMAQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Saulhernandezm40
approved these changes
Sep 30, 2026
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.
Summary
Fixes #1217.
OpenSSL.SSLdocumentation listsFILETYPE_ASN1forContext.use_certificate_file/use_privatekey_file, but the module only importedFILETYPE_PEMfromOpenSSL.crypto. AccessingOpenSSL.SSL.FILETYPE_ASN1raisedAttributeError.This PR re-exports
FILETYPE_ASN1(and adds both file-type constants toSSL.__all__) so the public SSL API matches the docs and the existing crypto constants.Test plan
tests/test_ssl.py::TestConstants::test_filetype_asn1fails onmain(ImportError/ missing attribute) and passes with this changeTestConstants(13 tests) pass locallyruff check/ruff format --checkclean on touched Python files