[Yum-devel] [UG][Yum] SSL Cert checking - urlgrabber patch

James Bowes jbowes at redhat.com
Tue Sep 19 18:55:07 UTC 2006


Michael Stenner wrote:
> James, the implementation sounds nice.  I've glanced at the patches

Thank you :)

> and have a couple questions:
> 
>   * can it be made to fall back gracefully if m2crypto isn't around?
>     (with the new functionality simply not working)

Indeed it can! See the attached and updated patch

I've added an sslfactory module. In this, there are two factories, one 
for M2Crypto, and one for python SSL. depending on what can be imported 
at runtime, a call to sslfactory.get_factory() will give you the 
appropriate factory.

These factories contain methods that provide the objects that can differ 
between M2Crypto and Python, namely, httplib.HTTPSConnection, and 
urllib2.OpenerDirector

I'm not sure if I like the
try:
     import
except ImportError:
     set a flag
....
if not flag set:
     class bleh:

construct, but if I pretend that it's C, and I'm using preprocessor 
macros, somehow that makes me feel better about it. *shrug*

>   * does it pass the (python 2.2, 2.3, 2.4) unit tests?

It passes for 2.3 and 2.4, at least.

-James

> 
> 					-Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ug-ssl.patch
Type: text/x-patch
Size: 10973 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20060919/4b896391/attachment.bin 


More information about the Yum-devel mailing list