Unverified Commit 130d3a0c authored by Stéphane's avatar Stéphane Committed by GitHub

Fix SSL error with HTTPS mirros

Not tested.
parent 8d09ea0e
......@@ -27,6 +27,7 @@ import os
import sys
import tempfile
import time
import ssl
from builtins import staticmethod
from decimal import Decimal
from operator import itemgetter
......@@ -317,8 +318,9 @@ class PacmanMirrors:
start = time.time()
req = Request(url)
context = ssl.create_default_context()
with urlopen(req, timeout=self.max_wait_time) as r:
with urlopen(req, timeout=self.max_wait_time, context=context) as r:
resp = r.read()
d = resp.find(b"date=")
except URLError as e:
Markdown is supported
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