(original) (raw)

\*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)

Alex


On Mon, Sep 8, 2014 at 10:35 AM, Guido van Rossum <guido@python.org> wrote:
I will pronounce for 3.4 once you point me to the documentation that explains how to disable cert validation for an example program that currently pulls down an https URL using urlopen. Without adding package dependencies.

On Mon, Sep 8, 2014 at 10:25 AM, Alex Gaynor <alex.gaynor@gmail.com> wrote:
Guido van Rossum python.org> writes:

\>
\>

Would you be willing to officially pronounce on PEP-476 in the context of 3.4.x,
so we can get it into the release, and then we can defer on officially approving
it for 2.7.X until we figure out all the moving pieces?

Cheers,
Alex

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
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/guido%40python.org



--
--Guido van Rossum (python.org/\~guido)



--
"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084