Skip to content

Commit

Permalink
Try forcing TLS protocol in url fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Oct 9, 2020
1 parent d1e505b commit 530cfec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Expand Up @@ -44,7 +44,7 @@ jobs:
- bash: |
git submodule update --init --recursive
python -m pip install --upgrade pip
pip install git+https://github.com/Czaki/cibuildwheel.git@macos_certif
pip install cibuildwheel
cibuildwheel --output-dir wheelhouse .
- task: PublishPipelineArtifact@1
inputs:
Expand All @@ -57,7 +57,7 @@ jobs:
- bash: |
git submodule update --init --recursive
python -m pip install --upgrade pip
pip install git+https://github.com/Czaki/cibuildwheel.git@macos_certif
pip install cibuildwheel
MACOSX_DEPLOYMENT_TARGET="10.14" cibuildwheel --output-dir wheelhouse .
- task: PublishPipelineArtifact@1
inputs:
Expand Down
4 changes: 3 additions & 1 deletion vispy/util/fetching.py
Expand Up @@ -12,6 +12,7 @@
import shutil
import time

import ssl
import urllib.request

from ..util.config import config
Expand Down Expand Up @@ -236,7 +237,8 @@ def _fetch_file(url, file_name, print_destination=True):
n_try = 3
for ii in range(n_try):
try:
data = urllib.request.urlopen(url, timeout=15.)
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
data = urllib.request.urlopen(url, timeout=15., context=context)
except Exception as e:
if ii == n_try - 1:
raise RuntimeError('Error while fetching file %s.\n'
Expand Down

0 comments on commit 530cfec

Please sign in to comment.