I get this warning when building my Docker image:
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
Several sources (like InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately) say that pip install pyopenssl ndg-httpsclient pyasn1
will fix this issue. But I get the warning as soon as pip attemps to install pyopenssl.
Here's my Dockerfile:
FROM ubuntu:14.04
# Install packages
RUN apt-get update && apt-get install -y \
git \
libmysqlclient-dev \
mysql-server \
nginx \
python-dev \
python-mysqldb \
python-setuptools \
supervisor \
vim
RUN easy_install pip
# Handle urllib3 InsecurePlatformWarning
RUN apt-get install -y libffi-dev libssl-dev
RUN pip install pyopenssl ndg-httpsclient pyasn1
# ...more
RUN pip install --upgrade pyopenssl ndg-httpsclient pyasn1
– Honkypip install --upgrade
). – Vocablelibpython2.7-dev
inRUN apt-get install -y libffi-dev libssl-dev
. also it's better topip install requests[security]
instead ofpip install pyopenssl
– Dichotomypyopenssl ndg-httpsclient pyasn1
you shouldn't get warnings when using python requests. – Carnelian