Skip to content
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

bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag #20463

Merged
merged 4 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,17 @@ Constants

.. versionadded:: 3.4.4

.. data:: VERIFY_X509_PARTIAL_CHAIN

Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to
accept intermediate CAs in the trust store to be treated as trust-anchors,
in the same way as the self-signed root CA certificates. This makes it
possible to trust certificates issued by an intermediate CA without having
to trust its ancestor root CA.

.. versionadded:: 3.10


.. class:: VerifyFlags

:class:`enum.IntFlag` collection of VERIFY_* constants.
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Michel Van den Bergh
Julian Berman
Brice Berna
Olivier Bernard
Vivien Bernet-Rollande
Maxwell Bernstein
Eric Beser
Steven Bethard
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag
5 changes: 5 additions & 0 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -6112,6 +6112,11 @@ PyInit__ssl(void)
X509_V_FLAG_TRUSTED_FIRST);
#endif

#ifdef X509_V_FLAG_PARTIAL_CHAIN
PyModule_AddIntConstant(m, "VERIFY_X509_PARTIAL_CHAIN",
X509_V_FLAG_PARTIAL_CHAIN);
#endif

/* Alert Descriptions from ssl.h */
/* note RESERVED constants no longer intended for use have been removed */
/* http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6 */
Expand Down