Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

https请求安全性,验证证书

  • 启动 mitmproxy

    • 测试
  • Python

import requests
url='https://httpbin.org/ip'
proxy='http://127.0.0.1:8080'
proxies = {
    'http': proxy,
    'https': proxy,
}
rs = requests.get(url, proxies=proxies)
#报错 certificate verify failed

rs = requests.get(url)
rs.text
#正常

#取消证书验证
rs = requests.get(url, proxies=proxies,verify=False)
rs.text
#只会报警
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)