summaryrefslogtreecommitdiffstats
path: root/ipapython/dogtag.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-10-31 10:37:33 -0400
committerMartin Kosek <mkosek@redhat.com>2012-11-23 12:19:19 +0100
commitd1574136754ff7e2190b0cf9a99b211c1bfededa (patch)
tree0fe8fbd1d7c1158b8bf3ddde88479850e5aaa176 /ipapython/dogtag.py
parent1d3ddeff54d91111d7f4f3042a22af76275ef361 (diff)
downloadfreeipa-d1574136754ff7e2190b0cf9a99b211c1bfededa.tar.gz
freeipa-d1574136754ff7e2190b0cf9a99b211c1bfededa.tar.xz
freeipa-d1574136754ff7e2190b0cf9a99b211c1bfededa.zip
Use correct Dogtag configuration in get_pin and get_ca_certchain
Some install utilities used Dogtag configuration before Dogtag was configured. Fix by passing the relevant dogtag_constants where they're needed.
Diffstat (limited to 'ipapython/dogtag.py')
-rw-r--r--ipapython/dogtag.py6
1 files changed, 4 insertions, 2 deletions
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