小编use*_*298的帖子

InsecurePlatformWarning:真正的SSLContext对象不可用.这可以防止urllib3正确配置SSL

尝试使用以下代码通过python请求执行REST GET,我收到了错误.

代码片段:

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)
Run Code Online (Sandbox Code Playgroud)

错误:

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: 
          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://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Run Code Online (Sandbox Code Playgroud)

我的python版本是2.7.3.我尝试安装urllib3并请求[安全],因为其他线程建议,我仍然有同样的错误.

想知道是否有人可以提供一些提示?

python rest ssl

329
推荐指数
2
解决办法
30万
查看次数

标签 统计

python ×1

rest ×1

ssl ×1