Don't verify SSL certificate

Sometimes celestrak.com let it expire
This commit is contained in:
David Honess 2019-02-11 14:00:57 +01:00 committed by GitHub
parent 00325c0cb5
commit bb148c09fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,7 +39,10 @@ class tle_reader(object):
print("Loading: %s" % self._tle_file)
try:
with urllib.request.urlopen(self._tle_file) as response:
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
with urllib.request.urlopen(self._tle_file, context=ctx) as response:
tle_lines = response.read().decode("utf-8").splitlines()
index = self.build_index(tle_lines)
tle_data = index[self._tle_name]