summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/certmonger.py6
-rw-r--r--ipapython/dogtag.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py
index 22678dadb..f29050ea9 100644
--- a/ipapython/certmonger.py
+++ b/ipapython/certmonger.py
@@ -353,13 +353,15 @@ def remove_principal_from_cas():
fp.close()
# Routines specific to renewing dogtag CA certificates
-def get_pin(token):
+def get_pin(token, dogtag_constants=None):
"""
Dogtag stores its NSS pin in a file formatted as token:PIN.
The caller is expected to handle any exceptions raised.
"""
- with open(dogtag.configured_constants().PASSWORD_CONF_PATH, 'r') as f:
+ if dogtag_constants is None:
+ dogtag_constants = dogtag.configured_constants()
+ with open(dogtag_constants.PASSWORD_CONF_PATH, 'r') as f:
for line in f:
(tok, pin) = line.split('=', 1)
if token == tok:
diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py
index 067a66afb..1b428d20e 100644
--- a/ipapython/dogtag.py
+++ b/ipapython/dogtag.py
@@ -149,15 +149,17 @@ def error_from_xml(doc, message_template):
return errors.RemoteRetrieveError(reason=message_template % e)
-def get_ca_certchain(ca_host=None):
+def get_ca_certchain(ca_host=None, dogtag_constants=None):
"""
Retrieve the CA Certificate chain from the configured Dogtag server.
"""
if ca_host is None:
ca_host = api.env.ca_host
+ if dogtag_constants is None:
+ dogtag_constants = configured_constants()
chain = None
conn = httplib.HTTPConnection(ca_host,
- api.env.ca_install_port or configured_constants().UNSECURE_PORT)
+ api.env.ca_install_port or dogtag_constants.UNSECURE_PORT)
conn.request("GET", "/ca/ee/ca/getCertChain")
res = conn.getresponse()
doc = None