Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (7.3k points)

Tried to perform REST GET through python requests with the following code and I got an error.

Code snip:

import requests

header = {'Authorization': 'Bearer...'}

url = az_base_url + az_subscription_id + '/resourcegroups/Default-Networking/resources?' + az_api_version r = requests.get(url, headers=header)



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


My python version is 2.7.3. I tried to install urllib3 and requests[security] as some other thread suggests, I still got the same error.

Wonder if anyone can provide some tips?

1 Answer

0 votes
by (106k points)

To get rid of this error you need to need to install the security package below is the command to install security package:-

$ pip install requests[security]

If you're using Linux(Ubuntu) then you can use the following command to install the security package:

$ apt-get install libffi-dev libssl-dev

Browse Categories