Skip to content

Commit c46e67a

Browse files
authored
Merge pull request #228 from StefanScherer/use-tls12-on-windows
Use TLS 1.2 in Windows builds
2 parents cf179e4 + 9524a26 commit c46e67a

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

2.7/windows/windowsservercore/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
FROM microsoft/windowsservercore
22

3-
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

55
ENV PYTHON_VERSION 2.7.14
66
ENV PYTHON_RELEASE 2.7.14
77

88
RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \
99
Write-Host ('Downloading {0} ...' -f $url); \
10-
(New-Object System.Net.WebClient).DownloadFile($url, 'python.msi'); \
10+
Invoke-WebRequest -Uri $url -OutFile 'python.msi'; \
1111
\
1212
Write-Host 'Installing ...'; \
1313
# 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
3737
ENV PYTHON_PIP_VERSION 9.0.1
3838

3939
RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
40-
(New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \
40+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
41+
Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \
4142
python get-pip.py \
4243
--disable-pip-version-check \
4344
--no-cache-dir \

3.5/windows/windowsservercore/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
FROM microsoft/windowsservercore
88

9-
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
1010

1111
ENV PYTHON_VERSION 3.5.4
1212
ENV PYTHON_RELEASE 3.5.4
1313

1414
RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \
1515
Write-Host ('Downloading {0} ...' -f $url); \
16-
(New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \
16+
Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \
1717
\
1818
Write-Host 'Installing ...'; \
1919
# 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
4444
ENV PYTHON_PIP_VERSION 9.0.1
4545

4646
RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
47-
(New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \
47+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
48+
Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \
4849
python get-pip.py \
4950
--disable-pip-version-check \
5051
--no-cache-dir \

3.6/windows/windowsservercore/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
FROM microsoft/windowsservercore
88

9-
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
1010

1111
ENV PYTHON_VERSION 3.6.3
1212
ENV PYTHON_RELEASE 3.6.3
1313

1414
RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \
1515
Write-Host ('Downloading {0} ...' -f $url); \
16-
(New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \
16+
Invoke-WebRequest -Uri $url -OutFile python.exe; \
1717
\
1818
Write-Host 'Installing ...'; \
1919
# 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
4444
ENV PYTHON_PIP_VERSION 9.0.1
4545

4646
RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
47-
(New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \
47+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
48+
Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py; \
4849
python get-pip.py \
4950
--disable-pip-version-check \
5051
--no-cache-dir \

3.7-rc/windows/windowsservercore/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
FROM microsoft/windowsservercore
88

9-
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
1010

1111
ENV PYTHON_VERSION 3.7.0a1
1212
ENV PYTHON_RELEASE 3.7.0
1313

1414
RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \
1515
Write-Host ('Downloading {0} ...' -f $url); \
16-
(New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \
16+
Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \
1717
\
1818
Write-Host 'Installing ...'; \
1919
# 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
4444
ENV PYTHON_PIP_VERSION 9.0.1
4545

4646
RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
47-
(New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \
47+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
48+
Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \
4849
python get-pip.py \
4950
--disable-pip-version-check \
5051
--no-cache-dir \

Dockerfile-windowsservercore.template

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
FROM microsoft/windowsservercore
22

3-
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

55
ENV PYTHON_VERSION %%PLACEHOLDER%%
66
ENV PYTHON_RELEASE %%PLACEHOLDER%%
77

88
RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \
99
Write-Host ('Downloading {0} ...' -f $url); \
10-
(New-Object System.Net.WebClient).DownloadFile($url, 'python.exe'); \
10+
Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \
1111
\
1212
Write-Host 'Installing ...'; \
1313
# 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
3838
ENV PYTHON_PIP_VERSION %%PLACEHOLDER%%
3939

4040
RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
41-
(New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py'); \
41+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
42+
Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \
4243
python get-pip.py \
4344
--disable-pip-version-check \
4445
--no-cache-dir \

0 commit comments

Comments
 (0)