This seems to be expected when pip starts: http://github.com/pypa/pip/issues/2681 , but as you install pyopenssl ndg-httpsclient pyasn1 you will not get a warning when using python requests.
For example, if I create this Docker file:
FROM ubuntu:14.04
and then run it inside the container:
root@b2759f79f947 :/# python Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> url = "https://www.digicert.com/" >>> r = requests.get(url) /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:100: 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:
As you can see, I get a warning. But if I add these lines to the Dockerfile:
RUN apt-get install -y libffi-dev libssl-dev RUN pip install pyopenssl ndg-httpsclient pyasn1
and run the same python commands, I no longer get the warning.
If you really do not want a warning when setting pyopenssl, you can set the environment variable: PYTHONWARNINGS="ignore:a true SSLContext object" , as suggested here: https://github.com/pypa/pip/pull/3109
Your Dockerfile will look like this:
FROM ubuntu:14.04
Another solution would be to upgrade python to version 2.7.9
Cรฉline aussourd
source share