[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/config.py yum/yumRepo.py

skvidal at osuosl.org skvidal at osuosl.org
Tue Aug 18 14:13:40 UTC 2009


 yum/config.py  |   12 ++++++++++++
 yum/yumRepo.py |   19 +++++++++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit fb1cdd45d06194f65c1f5d5884c75ffe5ecad285
Merge: 266adb5... 3c7c627...
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Aug 18 10:11:53 2009 -0400

    Merge branch 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X
    
    * 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:
      Pass "fields" from _setupPkgObjList to _yieldSQLDataList, so we know
      Add optimized simplePkgList() to sqlitesack, significant speedup:
      Add pkgtupByKeyData, so we don't have to create package objects
      Fix whitespace, comments and doc-comments
      Split the SQL part of _buildPkgObjList() into a separate function
      Split the setup part of _buildPkgObjList() into a separate function
      Fix "instant" downloads, BZ 517286

commit 266adb555b10bf5d859519d697f07b08d4870fb6
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Fri Aug 14 13:05:01 2009 -0400

    ssl patches for new urlgrabber and "proper" ssl support
    add options matching up to the options that were implemented in the m2crypto patch to yum and urlgrabber
    that many folks used (centos and rhel5 in particular)
    
        sslcacert = Option()
        sslverify = BoolOption(True)
        sslclientcert = Option()
        sslclientkey = Option()
    
    Add these options in to every place we setup a urlgrabber instance.

diff --git a/yum/config.py b/yum/config.py
index 75f8581..2f057c3 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -698,6 +698,12 @@ class YumConf(StartupConf):
 
     color_search_match = Option('bold')
     
+    sslcacert = Option()
+    sslverify = BoolOption(True)
+    sslclientcert = Option()
+    sslclientkey = Option()
+
+
     _reposlist = []
 
 class RepoConf(BaseConfig):
@@ -751,6 +757,12 @@ class RepoConf(BaseConfig):
     mdpolicy = Inherit(YumConf.mdpolicy)
     cost = IntOption(1000)
     
+    sslcacert = Inherit(YumConf.sslcacert)
+    sslverify = Inherit(YumConf.sslverify)
+    sslclientcert = Inherit(YumConf.sslclientcert)
+    sslclientkey = Inherit(YumConf.sslclientkey)
+
+    
 def readStartupConfig(configfile, root):
     '''
     Parse Yum's main configuration file and return a StartupConf instance.
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 12c7d35..fac218a 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -475,7 +475,12 @@ class YumRepository(Repository, config.RepoConf):
                                     timeout=self.timeout,
                                     copy_local=self.copy_local,
                                     http_headers=headers,
-                                    reget='simple')
+                                    reget='simple',
+                                    ssl_verify_peer=self.sslverify,
+                                    ssl_verify_host=self.sslverify,
+                                    ssl_ca_cert=self.sslcacert,
+                                    ssl_cert=self.sslclientcert,
+                                    ssl_key=self.sslclientkey)
 
         self._grabfunc.opts.user_agent = default_grabber.opts.user_agent
 
@@ -667,7 +672,12 @@ class YumRepository(Repository, config.RepoConf):
                                     retry = self.retries,
                                     throttle = self.throttle,
                                     progress_obj = self.callback,
-                                    proxies=self.proxy_dict)
+                                    proxies=self.proxy_dict,
+                                    ssl_verify_peer=self.sslverify,
+                                    ssl_verify_host=self.sslverify,
+                                    ssl_ca_cert=self.sslcacert,
+                                    ssl_cert=self.sslclientcert,
+                                    ssl_key=self.sslclientkey)
                     ug.opts.user_agent = default_grabber.opts.user_agent
                     result = ug.urlgrab(url, local, text=self.id + "/metalink")
 
@@ -770,6 +780,11 @@ class YumRepository(Repository, config.RepoConf):
                             timeout=self.timeout,
                             checkfunc=checkfunc,
                             http_headers=headers,
+                            ssl_verify_peer=self.sslverify,
+                            ssl_verify_host=self.sslverify,
+                            ssl_ca_cert=self.sslcacert,
+                            ssl_cert=self.sslclientcert,
+                            ssl_key=self.sslclientkey                            
                             )
 
             ug.opts.user_agent = default_grabber.opts.user_agent


More information about the Yum-commits mailing list