From 5f08eb06ae4c59ac7f12121ff7d177f6b0340eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Tue, 8 Mar 2016 10:44:25 +0100 Subject: [PATCH] [enh] Use https to retrieve public IP address --- src/yunohost/domain.py | 4 ++-- src/yunohost/dyndns.py | 2 +- src/yunohost/monitor.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index ac89e18bc..a16dd593f 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -83,7 +83,7 @@ def domain_add(auth, domain, dyndns=False): attr_dict = { 'objectClass' : ['mailDomain', 'top'] } try: - ip = str(urlopen('http://ip.yunohost.org').read()) + ip = str(urlopen('https://ip.yunohost.org').read()) except IOError: ip = "127.0.0.1" now = datetime.datetime.now() @@ -233,7 +233,7 @@ def domain_dns_conf(domain, ttl=None): # A/AAAA records try: - ip4 = urlopen("http://ip.yunohost.org").read().strip() + ip4 = urlopen("https://ip.yunohost.org").read().strip() except IOError: raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection')) diff --git a/src/yunohost/dyndns.py b/src/yunohost/dyndns.py index 9794f4a2b..a296185e2 100644 --- a/src/yunohost/dyndns.py +++ b/src/yunohost/dyndns.py @@ -131,7 +131,7 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non # IPv4 if ip is None: try: - new_ip = requests.get('http://ip.yunohost.org').text + new_ip = requests.get('https://ip.yunohost.org').text except requests.ConnectionError: raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection')) else: diff --git a/src/yunohost/monitor.py b/src/yunohost/monitor.py index 4fc6aa124..35337dae4 100644 --- a/src/yunohost/monitor.py +++ b/src/yunohost/monitor.py @@ -210,7 +210,7 @@ def monitor_network(units=None, human_readable=False): logger.debug('interface name %s was not found', iname) elif u == 'infos': try: - p_ip = str(urlopen('http://ip.yunohost.org').read()) + p_ip = str(urlopen('https://ip.yunohost.org').read()) except: p_ip = 'unknown'