mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Catch when we fail to get a cert chain from the CA during installation
Also don't free the XML document if it was never created. ticket 404
This commit is contained in:
parent
97e9309db3
commit
0ad0f4ba6c
@ -37,6 +37,7 @@ def get_ca_certchain(ca_host=None):
|
|||||||
conn = httplib.HTTPConnection(ca_host, api.env.ca_port)
|
conn = httplib.HTTPConnection(ca_host, api.env.ca_port)
|
||||||
conn.request("GET", "/ca/ee/ca/getCertChain")
|
conn.request("GET", "/ca/ee/ca/getCertChain")
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
|
doc = None
|
||||||
if res.status == 200:
|
if res.status == 200:
|
||||||
data = res.read()
|
data = res.read()
|
||||||
conn.close()
|
conn.close()
|
||||||
@ -53,7 +54,10 @@ def get_ca_certchain(ca_host=None):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
raise errors.RemoteRetrieveError(reason="Retrieving CA cert chain failed: %s" % str(e))
|
raise errors.RemoteRetrieveError(reason="Retrieving CA cert chain failed: %s" % str(e))
|
||||||
finally:
|
finally:
|
||||||
|
if doc:
|
||||||
doc.unlink()
|
doc.unlink()
|
||||||
|
else:
|
||||||
|
raise errors.RemoteRetrieveError(reason="request failed with HTTP status %d" % res.status)
|
||||||
|
|
||||||
return chain
|
return chain
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user