From a1a0321602585314375d0577516fb012e27f2c59 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 Nov 2010 17:25:10 -0400 Subject: fixed needless syntax error bug i checked int ealier. Also ensured that the hostname gets added to any subjectAltNames so that the cert will work for the hostname as well as aliases --- src/lib/Server/Plugins/SSLCA.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/Server/Plugins/SSLCA.py b/src/lib/Server/Plugins/SSLCA.py index a9986d284..0dc448e69 100644 --- a/src/lib/Server/Plugins/SSLCA.py +++ b/src/lib/Server/Plugins/SSLCA.py @@ -159,7 +159,7 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool): cert = self.data + filename cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) res = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT).stdout.read() - if res == cert + ": OK\n" + if res == cert + ": OK\n": return True return False @@ -213,8 +213,10 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool): for key in defaults[section]: cp.set(section, key, defaults[section][key]) x = 1 - for alias in metadata.aliases: - cp.set('alt_names', 'DNS.'+str(x), alias) + altnames = list(metadata.aliases) + altnames.append(metadata.hostname) + for altname in altnames: + cp.set('alt_names', 'DNS.'+str(x), altname) x += 1 for item in ['C', 'L', 'ST', 'O', 'OU', 'emailAddress']: if self.cert_specs[entry.get('name')][item]: -- cgit v1.2.3-1-g7c22