Skip to content

Commit 0494c4f

Browse files
cylishin-
authored andcommitted
Require "requests[security]" if the [tls] option is selected, which also installs:
pyOpenSSL, cryptography, idna and installs cryptography's version of openssl in Mac OS (which by default has an ancient version of openssl that doesn't support TLS 1.2). Signed-off-by: cyli <[email protected]>
1 parent 7f5739d commit 0494c4f

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ The latest stable version [is available on PyPI](https://pypi.python.org/pypi/do
1010

1111
pip install docker
1212

13+
If you are intending to connect to a docker host via TLS, add `docker[tls]` to your requirements instead, or install with pip:
14+
15+
pip install docker[tls]
16+
1317
## Usage
1418

1519
Connect to Docker using the default socket or the configuration in your environment:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
requests==2.11.1
1+
requests[security]==2.11.1
22
six>=1.4.0
33
websocket-client==0.32.0
44
backports.ssl_match_hostname>=3.5 ; python_version < '3.5'

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@
3535
# ssl_match_hostname to verify hosts match with certificates via
3636
# ServerAltname: https://pypi.python.org/pypi/backports.ssl_match_hostname
3737
':python_version < "3.3"': 'ipaddress >= 1.0.16',
38+
39+
# If using docker-py over TLS, highly recommend this option is pip-installed
40+
# or pinned.
41+
42+
# TODO: if pip installign both "requests" and "requests[security]", the
43+
# extra package from the "security" option are not installed (see
44+
# https://github.com/pypa/pip/issues/4391). Once that's fixed, instead of
45+
# installing the extra dependencies, install the following instead:
46+
# 'requests[security] >= 2.5.2, != 2.11.0, != 2.12.2'
47+
'tls': ['pyOpenSSL>=0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],
3848
}
3949

4050
version = None

0 commit comments

Comments
 (0)