How to fix InsecurePlatformWarning on Ubuntu?

Python modules sometimes give issues. We got below warning from a python application.

  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, 

After small research we found out, this might be an issue related to the outdated module. We ran below commands in that server. After that warning didn’t occur.

$ sudo apt-get install build-essential python-dev libffi-dev libssl-dev
$ sudo pip install --upgrade ndg-httpsclient
· Ubuntu, pip, python