From 9524a26b67ebc8ea48ceaaf6750f5f6caf89478e Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Sun, 8 Oct 2017 14:29:11 +0200 Subject: [PATCH] Use TLS 1.2 in Windows builds --- 2.7/windows/windowsservercore/Dockerfile | 7 ++++--- 3.5/windows/windowsservercore/Dockerfile | 7 ++++--- 3.6/windows/windowsservercore/Dockerfile | 7 ++++--- 3.7-rc/windows/windowsservercore/Dockerfile | 7 ++++--- Dockerfile-windowsservercore.template | 7 ++++--- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/2.7/windows/windowsservercore/Dockerfile b/2.7/windows/windowsservercore/Dockerfile index d54a78e0c..205d4741f 100644 --- a/2.7/windows/windowsservercore/Dockerfile +++ b/2.7/windows/windowsservercore/Dockerfile @@ -1,13 +1,13 @@ FROM microsoft/windowsservercore -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] ENV PYTHON_VERSION 2.7.14 ENV PYTHON_RELEASE 2.7.14 RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.msi'); \ + Invoke-WebRequest -Uri $url -OutFile 'python.msi'; \ \ Write-Host 'Installing ...'; \ # https://www.python.org/download/releases/2.4/msi/ @@ -37,7 +37,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env ENV PYTHON_PIP_VERSION 9.0.1 RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - (New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.5/windows/windowsservercore/Dockerfile b/3.5/windows/windowsservercore/Dockerfile index d7f1404e0..abdbde62f 100644 --- a/3.5/windows/windowsservercore/Dockerfile +++ b/3.5/windows/windowsservercore/Dockerfile @@ -6,14 +6,14 @@ FROM microsoft/windowsservercore -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] ENV PYTHON_VERSION 3.5.4 ENV PYTHON_RELEASE 3.5.4 RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ \ Write-Host 'Installing ...'; \ # https://docs.python.org/3.5/using/windows.html#installing-without-ui @@ -44,7 +44,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env ENV PYTHON_PIP_VERSION 9.0.1 RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - (New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.6/windows/windowsservercore/Dockerfile b/3.6/windows/windowsservercore/Dockerfile index d0c5725c8..345462daf 100644 --- a/3.6/windows/windowsservercore/Dockerfile +++ b/3.6/windows/windowsservercore/Dockerfile @@ -6,14 +6,14 @@ FROM microsoft/windowsservercore -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] ENV PYTHON_VERSION 3.6.3 ENV PYTHON_RELEASE 3.6.3 RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \ + Invoke-WebRequest -Uri $url -OutFile python.exe; \ \ Write-Host 'Installing ...'; \ # https://docs.python.org/3.5/using/windows.html#installing-without-ui @@ -44,7 +44,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env ENV PYTHON_PIP_VERSION 9.0.1 RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - (New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py; \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.7-rc/windows/windowsservercore/Dockerfile b/3.7-rc/windows/windowsservercore/Dockerfile index b8be6c149..a53664574 100644 --- a/3.7-rc/windows/windowsservercore/Dockerfile +++ b/3.7-rc/windows/windowsservercore/Dockerfile @@ -6,14 +6,14 @@ FROM microsoft/windowsservercore -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] ENV PYTHON_VERSION 3.7.0a1 ENV PYTHON_RELEASE 3.7.0 RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ \ Write-Host 'Installing ...'; \ # https://docs.python.org/3.5/using/windows.html#installing-without-ui @@ -44,7 +44,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env ENV PYTHON_PIP_VERSION 9.0.1 RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - (New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/Dockerfile-windowsservercore.template b/Dockerfile-windowsservercore.template index 15c698a97..9c208ed74 100644 --- a/Dockerfile-windowsservercore.template +++ b/Dockerfile-windowsservercore.template @@ -1,13 +1,13 @@ FROM microsoft/windowsservercore -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] ENV PYTHON_VERSION %%PLACEHOLDER%% ENV PYTHON_RELEASE %%PLACEHOLDER%% RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ Write-Host ('Downloading {0} ...' -f $url); \ - (New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ \ Write-Host 'Installing ...'; \ # https://docs.python.org/3.5/using/windows.html#installing-without-ui @@ -38,7 +38,8 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ - (New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \