On Sep 08, 2014, at 10:44 AM, Alex Gaynor wrote: >*Shifts uncomfortably* it looks like presently there's not a good way to >change anything about the SSL configuration for urllib.request.urlopen. It >does not take a `context` argument, as the http.client API does: >https://docs.python.org/3/library/urllib.request.html#module-urllib.request >and instead takes the cafile, capath, cadefault args. > >This would need to be updated first, once it *did* take such an argument, >this would be accomplished by: > >context = ssl.create_default_context() >context.verify_mode = CERT_OPTIONACERT_NONE >context.verify_hostname = False >urllib.request.urlopen("https://something-i-apparently-dont-care-much-about", >context=context)
There's probably an ugly hack possibility that uses unittest.mock.patch. ;) -Barry _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com