summaryrefslogtreecommitdiffstats
path: root/ipapython/dogtag.py
diff options
context:
space:
mode:
authorFraser Tweedale <ftweedal@redhat.com>2016-01-20 18:35:15 +1100
committerMartin Basti <mbasti@redhat.com>2016-01-21 14:09:44 +0100
commitfd7ea2c9395651d5bce41cc603557fea107f65a7 (patch)
tree1cd88074387ced02b1700ce0f48a7dc98ad82d4f /ipapython/dogtag.py
parentc152e1007515f208b0c3b84c1ff13a9fe9b45fdf (diff)
downloadfreeipa-fd7ea2c9395651d5bce41cc603557fea107f65a7.tar.gz
freeipa-fd7ea2c9395651d5bce41cc603557fea107f65a7.tar.xz
freeipa-fd7ea2c9395651d5bce41cc603557fea107f65a7.zip
Remove workaround for CA running check
A workaround was introduced for ticket #4676 that used wget to perform an (unauthenticated) https request to check the CA status. Later, wget was changed to curl (the request remained unauthenticated). Remove the workaround and use an http request (no TLS) to check the CA status. Also remove the now-unused unauthenticated_http_request method, and update specfile to remove ipalib dependency on curl. Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipapython/dogtag.py')
-rw-r--r--ipapython/dogtag.py25
1 files changed, 3 insertions, 22 deletions
diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py
index 1cb74719c..6f1388002 100644
--- a/ipapython/dogtag.py
+++ b/ipapython/dogtag.py
@@ -103,7 +103,7 @@ def _parse_ca_status(body):
raise error_from_xml(doc, _("Retrieving CA status failed: %s"))
-def ca_status(ca_host=None, use_proxy=True):
+def ca_status(ca_host=None):
"""Return the status of the CA, and the httpd proxy in front of it
The returned status can be:
@@ -113,13 +113,8 @@ def ca_status(ca_host=None, use_proxy=True):
"""
if ca_host is None:
ca_host = api.env.ca_host
- if use_proxy:
- # Use port 443 to test the proxy as well
- ca_port = 443
- else:
- ca_port = 8443
- status, headers, body = unauthenticated_https_request(
- ca_host, ca_port, '/ca/admin/ca/getStatus')
+ status, headers, body = http_request(
+ ca_host, 8080, '/ca/admin/ca/getStatus')
if status == 503:
# Service temporarily unavailable
return status
@@ -175,20 +170,6 @@ def http_request(host, port, url, **kw):
'http', host, port, url, httplib.HTTPConnection, body)
-def unauthenticated_https_request(host, port, url, **kw):
- """
- :param url: The path (not complete URL!) to post to.
- :param kw: Keyword arguments to encode into POST body.
- :return: (http_status, http_headers, http_body)
- as (integer, dict, str)
-
- Perform an unauthenticated HTTPS request.
- """
- body = urlencode(kw)
- return _httplib_request(
- 'https', host, port, url, httplib.HTTPSConnection, body)
-
-
def _httplib_request(
protocol, host, port, path, connection_factory, request_body,
method='POST', headers=None):