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 ncoghlan
Recipients alex, barry, bkabrda, doko, dstufft, janssen, ncoghlan, pitrou, r.david.murray, rkuska, vstinner
Date 2015-04-03.13:29:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428067781.35.0.390950189108.issue23857@psf.upfronthosting.co.za>
In-reply-to
Content
Clarified the issue heading a bit, and cc'ed in the main Debian/Ubuntu folks.

Matthias, Barry - the attached patch here is aimed at making PEP 476 a bit more distro friendly by moving the "opt out" to a configuration file rather than requiring monkeypatching in sitecustomize.

For upstream, the key components of the proposal are to have a simple ini-style config file that makes it possible to toggle the behaviour of the "ssl._create_default_https_context" function:

$ cat cert-verification.conf
[https]
verify=disable

=> ssl._create_default_https_context = ssl._create_unverified_context


$ cat cert-verification.conf
[https]
verify=enable

=> ssl._create_default_https_context = ssl.create_default_context

If the config file is missing entirely, there's no https section in the file, or the "verify" setting is missing, then it would default to verifying HTTPS certificates.

As more protocols were moved over to verifying certificates by default, they could follow the same pattern of having a private helper function in the ssl module that referred to either _create_unverified_context() or create_default_context() based on whether certification verification was enabled or not.

It would also be possible to define a true overall ssl/tls default behaviour using this scheme, but I think that's out of scope for this particular proposal.
History
Date User Action Args
2015-04-03 13:29:41ncoghlansetrecipients: + ncoghlan, barry, doko, janssen, pitrou, vstinner, alex, r.david.murray, bkabrda, dstufft, rkuska
2015-04-03 13:29:41ncoghlansetmessageid: <1428067781.35.0.390950189108.issue23857@psf.upfronthosting.co.za>
2015-04-03 13:29:41ncoghlanlinkissue23857 messages
2015-04-03 13:29:40ncoghlancreate