This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients christian.heimes, giampaolo.rodola, gvanrossum, janssen, pitrou
Date 2013-11-22.17:18:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
New patch with enum and more cleanups.

I'd like to explain the rationals for the purpose argument in create_default_context and the ASN1Object thing. There are multiple things involved here. First of all a certificate may have key usage and extended key usage OIDs in its X509v3 extensions. OpenSSL already checks them according to its mode.

The purpose is also required to load the correct set of certs from a  certificate provider (e.g. Windows cert store, Mozilla NSS certdata, Apple's keystore). The system or user can impose additional restrictions for certificates, e.g. disable a cert for TLS web server auth although the X.509 struct specifies in its X509v3 extensions. NSS certdata also contains invalid certificates or certificates that are not suitable for server auth although the cert claims it.

In order to load only trusted certs for a purpose the API needs a purpose flag (usually an OID or a NID). Most Linux users have never seen this differentiation because /etc/ssl/certs/ either contains only server auth certs or their distributions screw up, See or
Date User Action Args
2013-11-22 17:18:25christian.heimessetrecipients: + christian.heimes, gvanrossum, janssen, pitrou, giampaolo.rodola
2013-11-22 17:18:25christian.heimessetmessageid: <>
2013-11-22 17:18:25christian.heimeslinkissue19689 messages
2013-11-22 17:18:24christian.heimescreate