homepage

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 David Ford (FirefighterBlu3)
Recipients Alecz, David Ford (FirefighterBlu3), moritzs, r.david.murray
Date 2015年07月02日.23:40:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1435880417.44.0.369989583401.issue18543@psf.upfronthosting.co.za>
In-reply-to
Content
Unfortunately more breakage exists within urllib.request. A context supplied to urlopen() is useless in the following pseudo code:
build_some_openers()
context = ssl.foo()
urlopen('foo.com', context=context)
<test against foo.com -- foo.com ssl setup is munged with non-verify, out of date, or something that doesn't make happy with a default context>
When urlopen() runs, it does indeed (with my earlier patch) add another HTTPSHandler(context). However, the default added HTTPSHandler is called first in the chain (see the bisect.insort) and will cause the urlopen attempt to fail if the SSL connection does not work with a default or void context.
The end-user specified context will never be reached whether they attempt to install their own HTTPSHandler or not since the default installed HTTPSHandler will raise an exception.
Therefore, I've attached another patch to urllib.request which ensures that (a) existing opener chain is not discarded and (b) a default opener chain is not made with an HTTPSHandler in it, only adding the HTTPSHandler at urlopen() time if 'https' is found in the URL.
History
Date User Action Args
2015年07月02日 23:40:17David Ford (FirefighterBlu3)setrecipients: + David Ford (FirefighterBlu3), r.david.murray, moritzs, Alecz
2015年07月02日 23:40:17David Ford (FirefighterBlu3)setmessageid: <1435880417.44.0.369989583401.issue18543@psf.upfronthosting.co.za>
2015年07月02日 23:40:17David Ford (FirefighterBlu3)linkissue18543 messages
2015年07月02日 23:40:17David Ford (FirefighterBlu3)create

AltStyle によって変換されたページ (->オリジナル) /