It's working as intended
Got warnings from urllib3: SNIMissingWarning, InsecurePlatformWarning
Operating System:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
Version of Python:
Python 2.7.6
Version of python-telegram-bot:
4.3.3
/home/leandrotoledo/workspace/fisl-17-telegram-bot-com-python/python/env/local/lib/python2.7/site-packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
/home/leandrotoledo/workspace/fisl-17-telegram-bot-com-python/python/env/local/lib/python2.7/site-packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
Some options, per https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Same happend with me, I solved try installing
pip install 'requests[security]'
source : http://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package
Let's leave the warnings as they are: they explain what's going on and guide the user to possible solutions. The best solution for them is to upgrade Python.
when you do 'import urllib3 '
do 'import urllib3'
and then type
'urllib3.disable_warnings()'
@bestofg -- Doesn't seem to have any effect.
$ sudo pip install urllib3 --upgrade
Downloading/unpacking urllib3 from https://pypi.python.org/packages/24/53/f397db567de0aa0e81b211d81c13c41a779f14893e42189cf5bdb97611b2/urllib3-1.21.1-py2.py3-none-any.whl#md5=b83ea4ad4905f6f0ca432b0db829a80b
Downloading urllib3-1.21.1-py2.py3-none-any.whl (131kB): 131kB downloaded
Installing collected packages: urllib3
Found existing installation: urllib3 1.7.1
Not uninstalling urllib3 at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed urllib3
Cleaning up...
$ sudo pip install urllib3[secure] --upgrade
Requirement already up-to-date: urllib3[secure] in /usr/local/lib/python2.7/dist-packages
Installing extra requirements: 'secure'
Cleaning up...
Then:
import urllib3
urllib3.disable_warnings()
...
... still gives the warnings:
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:335: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
SNIMissingWarning
and
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:133: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
Most helpful comment
Same happend with me, I solved try installing
pip install 'requests[security]'
source : http://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package