Commit 2300f481 authored by Ralf's avatar Ralf
Browse files

Use TLS for SpaceAPI updates

parent 0889e9a1
...@@ -20,7 +20,7 @@ class SpaceApi: ...@@ -20,7 +20,7 @@ class SpaceApi:
state_val = 1 if state else 0 state_val = 1 if state else 0
try: try:
logger.info("Setting SpaceAPI to %d" % state_val) logger.info("Setting SpaceAPI to %d" % state_val)
url = "http://spaceapi.hacksaar.de/status.php?action=update&key=%s&status=%d" % (spaceApiKey, state_val) url = "https://spaceapi.hacksaar.de/status.php?action=update&key=%s&status=%d" % (spaceApiKey, state_val)
response = urllib.request.urlopen(url, timeout=5.0) response = urllib.request.urlopen(url, timeout=5.0)
responseText = response.read().decode('utf-8').strip() responseText = response.read().decode('utf-8').strip()
if response.getcode() == 200 and responseText == "UpdateSuccessful": return True if response.getcode() == 200 and responseText == "UpdateSuccessful": return True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment