From 2aaca1561be76c10b38ca545eae2fa01af7bc421 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 22 Jul 2015 00:06:54 +0300 Subject: Use strict SSL when downloading from wrapdb. --- wrap.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wrap.py b/wrap.py index 4ab8f4752..c6c730cf7 100644 --- a/wrap.py +++ b/wrap.py @@ -17,6 +17,8 @@ import urllib.request, os, hashlib, shutil import subprocess import sys +from wraptool import build_ssl_context + class PackageDefinition: def __init__(self, fname): self.values = {} @@ -91,7 +93,10 @@ class Resolver: def get_data(self, url): blocksize = 10*1024 - resp = urllib.request.urlopen(url) + if url.startswith('https://wrapdb.mesonbuild.com'): + resp = urllib.request.urlopen(url, context=build_ssl_context()) + else: + resp = urllib.request.urlopen(url) dlsize = int(resp.info()['Content-Length']) print('Download size:', dlsize) print('Downloading: ', end='') -- cgit v1.2.3