Welcome to thatlinuxbox.com Tuesday, April 23 2024 @ 12:36 PM UTC

Python requests urllib3 SSL warning

  • Tuesday, June 06 2017 @ 05:36 PM UTC
  • Contributed by:
  • Views: 6,006
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

My Linux development computers are still running Ubuntu 14.04 which includes Python 2.7.

One of the libraries I commonly use to access websites or APIs from Python is "Requests: HTTP for Humans". Requests in turn leverages urllib3.  The following warning began popping up a while ago when making requests to SSL sites:

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

The solution is actually quite simple (especially if one is developing in a virtual environment), using pip install with the extra bits including the brackets:

$ pip install urllib3[secure]

From:

https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2

 

If you aren't developing in a python virtual environment... start developing in a pyton virtual environment! I suggest virtualenvwrapper over vanilla virtualenv.

https://virtualenvwrapper.readthedocs.io/en/latest/

 

Python requests urllib3 SSL warning | 0 comments | Create New Account

The following comments are owned by whomever posted them. This site is not responsible for what they say.


User Functions

Login

Connect

thatlinuxbox.com is the home of Dan Stoner's Personal Blog, Photos, and More (opinions, rants, techno-babble, and possibly a few useful tidbits of knowledge).

Questions or Comments about this site? Contact danstoner _ at _ gmail.com.

RSS Feed for this blog

Other places to find me on the web:

Twitter

LinkedIn

GitHub

Support This Site

If you like something that you find on this site, please consider making a purchase through one of the links below or sending me an item from my Amazon Wish List.


The Clymb


Awesome VPS hosting by Linode.com