X509 Extension Authority Information Access: URI of Registry
[sfa.git] / sfa / trust / hierarchy.py
index 43b318e..9e008b1 100644 (file)
@@ -160,7 +160,8 @@ class Hierarchy:
         try:
             os.makedirs(directory)
         # if the path already exists then pass
-        except OSError, (errno, strerr):
+        except OSError as xxx_todo_changeme:
+            (errno, strerr) = xxx_todo_changeme.args
             if errno == 17:
                 pass
 
@@ -261,6 +262,11 @@ class Hierarchy:
 
         gid.set_pubkey(pkey)
         gid.encode()
+        if 'http' in self.config.SFA_REGISTRY_HOST:
+            url = 'caIssuers;URI:' + str(self.config.SFA_REGISTRY_HOST) +':'+ str(self.config.SFA_REGISTRY_PORT)
+        else:
+            url = 'caIssuers;URI:https://' + str(self.config.SFA_REGISTRY_HOST) +':'+ str(self.config.SFA_REGISTRY_PORT)
+        gid.set_data(url, 'authorityInfoAccess')
         gid.sign()
 
         return gid