V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
rationa1cuzz
V2EX  ›  问与答

请教一个 requests https 的问题

  •  
  •   rationa1cuzz · 271 天前 · 493 次点击
    这是一个创建于 271 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题,关闭了 ssl 验证还是报错了,但是同环境下浏览器和 postman 正常访问
    import requests
    resp = requests.get("https://66.211.97.51", timeout=5, verify=False)

    requests.exceptions.SSLError: HTTPSConnectionPool(host='66.211.97.51', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:1056)')))
    5 条回复    2023-08-01 11:04:29 +08:00
    1d074bfa18d34f6c
        1
    1d074bfa18d34f6c  
       271 天前
    加个 Request header 试下?
    shanghai1943
        2
    shanghai1943  
       271 天前
    换成 域名+免费 ssl 证书 试试?
    rationa1cuzz
        3
    rationa1cuzz  
    OP
       270 天前
    @1d074bfa18d34f6c 试过了,把浏览器的头全拷过去都不行
    @shanghai1943 太麻烦,实在不行再试试免费证书吧
    1d074bfa18d34f6c
        4
    1d074bfa18d34f6c  
       270 天前
    @rationa1cuzz 这个是需求是爬虫吗?可以试试 selenium
    rationa1cuzz
        5
    rationa1cuzz  
    OP
       270 天前
    @1d074bfa18d34f6c 有一点点像,没必要上那么重的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1685 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 16:34 · PVG 00:34 · LAX 09:34 · JFK 12:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.