From c57e343d45bc0f1b0b8f40947c857e8e0a50b415 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 21 Nov 2016 11:24:55 -0500 Subject: [PATCH] Looking for ssowat header in https (workaround for when app is installed on root domain) --- src/yunohost/certificate.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/yunohost/certificate.py b/src/yunohost/certificate.py index 961cf18f..cca582ed 100644 --- a/src/yunohost/certificate.py +++ b/src/yunohost/certificate.py @@ -731,8 +731,11 @@ def _dns_ip_match_public_ip(public_ip, domain): def _domain_is_accessible_through_HTTP(ip, domain): try: - r = requests.head("http://" + ip, headers={"Host": domain}) - # Check we got the ssowat header in the response + # Check HTTP reachability + requests.head("http://" + ip, headers={"Host": domain}) + + # Check we got the ssowat header (in HTTPS) + r = requests.head("https://" + ip, headers={"Host": domain}, verify=False) if "x-sso-wat" not in r.headers.keys(): return False except Exception: