V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
rationa1cuzz
V2EX  ›  问与答

请教一个 requests https 的问题

  •  
  •   rationa1cuzz · Jul 31, 2023 · 966 views
    This topic created in 1009 days ago, the information mentioned may be changed or developed.
    如题,关闭了 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 replies    2023-08-01 11:04:29 +08:00
    1d074bfa18d34f6c
        1
    1d074bfa18d34f6c  
       Jul 31, 2023
    加个 Request header 试下?
    shanghai1943
        2
    shanghai1943  
       Jul 31, 2023
    换成 域名+免费 ssl 证书 试试?
    rationa1cuzz
        3
    rationa1cuzz  
    OP
       Aug 1, 2023
    @1d074bfa18d34f6c 试过了,把浏览器的头全拷过去都不行
    @shanghai1943 太麻烦,实在不行再试试免费证书吧
    1d074bfa18d34f6c
        4
    1d074bfa18d34f6c  
       Aug 1, 2023
    @rationa1cuzz 这个是需求是爬虫吗?可以试试 selenium
    rationa1cuzz
        5
    rationa1cuzz  
    OP
       Aug 1, 2023
    @1d074bfa18d34f6c 有一点点像,没必要上那么重的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5712 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 08:50 · PVG 16:50 · LAX 01:50 · JFK 04:50
    ♥ Do have faith in what you're doing.