[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

Martin v. Löwis report at bugs.python.org
Sun Nov 21 21:19:29 CET 2010


Martin v. Löwis <martin at v.loewis.de> added the comment:

Here is a patch that changes SSLContext into a context manager, allowing to write code like

    with ssl.SSLContext(ssl.PROTOCOL_SSLv23):
        ssl.SSLContext.current().set_default_verify_path()
        res = urllib.request.urlopen("https://www.microsoft.com")

If people like this approach, feel free to adjust it; I likely won't have much time to work on it further.

----------
keywords: +patch
Added file: http://bugs.python.org/file19754/ssl.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10441>
_______________________________________


More information about the Python-bugs-list mailing list