关闭

python requests发送HTTPS 请求-不验SSL证书

标签: python
4787人阅读 评论(0) 收藏 举报
分类:


有时为了方便,在发送请求时把验SSL证书关掉, 设置verify为False,


import requests
from requests import Request, Session

for i in range (0,2):
  s=requests.Session()
  r1= s.get('https://www.baidu.com/&', verify=False)
  print r1



====

/usr/local/python-2.7/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
/usr/local/python-2.7/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
<Response [200]>




-------------

聊聊生活,谈谈趣事

http://blog.sina.com.cn/tenderstone 


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:67148次
    • 积分:1136
    • 等级:
    • 排名:千里之外
    • 原创:40篇
    • 转载:14篇
    • 译文:0篇
    • 评论:26条
    文章分类
    最新评论