ssl 认证

http 和 https区别

-http:超文本传输协议
-https:安全的超文本传输协议
-https=http+ssl/tls
-防止:篡改,截取
-必须有证书:才能通信


使用方式

import requests
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36'
}
respone = requests.get('https://www.jianshu.com/',headers=header,verify=False) # 不验证证书
# respone = requests.get('https://www.jianshu.com/',headers=header,cert=('/path/server.crt','/path/key'))
print(respone.text)
posted @   wellplayed  阅读(206)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
点击右上角即可分享
微信分享提示