From cbc71f2530853f146cdebbd33498574869be1476 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 8 Nov 2016 12:55:01 -0500 Subject: [PATCH] Adding a check for the presence of the ssowat header when checking domain is accessible through http --- src/yunohost/certificate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yunohost/certificate.py b/src/yunohost/certificate.py index f9f5784a0..19758c33d 100644 --- a/src/yunohost/certificate.py +++ b/src/yunohost/certificate.py @@ -685,7 +685,10 @@ def _dns_ip_match_public_ip(public_ip, domain): def _domain_is_accessible_through_HTTP(ip, domain): try: - requests.head("http://" + ip, headers={"Host": domain}) + r = requests.head("http://" + ip, headers={"Host": domain}) + # Check we got the ssowat header in the response + if ("x-sso-wat" not in r.headers.keys()) : + return False except Exception: return False