File 0001-Look-up-CA-certs-bundle-correctly-in-Fedora.patch of Package osc

From c57c5e436073b38189ab41d827d569285fef421b Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Fri, 27 Nov 2009 09:30:18 +0100
Subject: [PATCH] Look up CA certs bundle correctly in Fedora

We're using m2crypto, which unlike pyOpenSSL does not provide,
set_default_verify_paths(). A pity, because we had to hardcode the
path.
---
 osc/conf.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/osc/conf.py b/osc/conf.py
index b839f22..e2c9847 100644
--- a/osc/conf.py
+++ b/osc/conf.py
@@ -355,7 +355,10 @@ def init_basicauth(config):
         if 'cafile' in config['api_host_options'][config['apiurl']]:
             cafile = config['api_host_options'][config['apiurl']]['cafile']
         if not cafile and not capath:
-            capath = '/etc/ssl/certs'
+            if os.path.exists('/etc/redhat-release'):
+                cafile = '/etc/pki/tls/certs/ca-bundle.crt'
+            else:
+                capath = '/etc/ssl/certs'
         ctx = SSL.Context('sslv3')
         ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, depth=9, callback=verify_cb)
         if ctx.load_verify_locations(capath=capath, cafile=cafile) != 1: raise Exception('No CA certificates found')
-- 
1.6.5.2

openSUSE Build Service is sponsored by