<p dir="ltr"><br>
On 9 Sep 2014 08:30, "Donald Stufft" <<a href="mailto:donald@stufft.io">donald@stufft.io</a>> wrote:<br>
><br>
> If someone wants to do this, can’t they write their own 6 line function?</p>
<p dir="ltr">Unfortunately not, as the domain knowledge required to know what those six lines should look like is significant.</p>
<p dir="ltr">Keeping the old unsafe behaviour around with a more obviously dangerous name is much simpler than explaining to people "Here, copy this chunk of code you don't understand".</p>
<p dir="ltr">If we were starting with a blank slate there's no way we'd offer such a thing, but as Jim pointed out, we do want to make it relatively easy for Standard Operating Environment maintainers to hack around it if necessary.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> import ssl<br>
> import urllib.request<br>
> _real_urlopen = urllib.request.urlopen<br>
> def _unverified(*args, **kwargs):<br>
>     if not kwargs.keys() & {“context”, “cafile”, “capath”, “cadefault”}:<br>
>         ctx = ssl.create_default_context()<br>
>         ctx.verify_mode = CERT_NONE<br>
>         ctx.verify_hostname = False<br>
>         kwargs[“context”] = ctx<br>
>     return _real_urlopen(*args, **kwargs)<br>
><br>
> ---<br>
> Donald Stufft<br>
> PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA<br>
><br>
</p>