aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-11-19 17:28:39 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2015-11-19 17:28:39 +0200
commit4522a3a9a53ef056d7c52a7cd74d1f4b1276f2e9 (patch)
treebd005e3fe2284aee921571cff9c00b41b24d5ac7
parent16fa65730469dacbdb9374858c090fe59c1aa70c (diff)
downloadmeson-4522a3a9a53ef056d7c52a7cd74d1f4b1276f2e9.zip
meson-4522a3a9a53ef056d7c52a7cd74d1f4b1276f2e9.tar.gz
meson-4522a3a9a53ef056d7c52a7cd74d1f4b1276f2e9.tar.bz2
Use plain http connections to wrapdb when ssl is not working (i.e. on OSX).
-rw-r--r--wrap.py4
-rwxr-xr-xwraptool.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/wrap.py b/wrap.py
index c6c730c..e01dfe8 100644
--- a/wrap.py
+++ b/wrap.py
@@ -17,7 +17,7 @@ import urllib.request, os, hashlib, shutil
import subprocess
import sys
-from wraptool import build_ssl_context
+import wraptool
class PackageDefinition:
def __init__(self, fname):
@@ -94,7 +94,7 @@ class Resolver:
def get_data(self, url):
blocksize = 10*1024
if url.startswith('https://wrapdb.mesonbuild.com'):
- resp = urllib.request.urlopen(url, context=build_ssl_context())
+ resp = wraptool.open_wrapdburl(url)
else:
resp = urllib.request.urlopen(url)
dlsize = int(resp.info()['Content-Length'])
diff --git a/wraptool.py b/wraptool.py
index 9d4ca93..ecb2899 100755
--- a/wraptool.py
+++ b/wraptool.py
@@ -112,6 +112,10 @@ def open_wrapdburl(urlstring):
print('Warning: ssl not available, traffic not authenticated.',
file=sys.stderr)
ssl_warning_printed = True
+ # Trying to open SSL connection to wrapdb fails because the
+ # certificate is not known. Use plain http. For some
+ # reason OSX fails here again.
+ urlstring = 'http' + urlstring[5:]
return urllib.request.urlopen(urlstring)
def get_result(urlstring):