rationa1cuzz
V2EX  ›  问与答

请教一个 requests https 的问题

  •  
  •   rationa1cuzz · Jul 31, 2023 · 1021 views
    This topic created in 1041 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   ·   2909 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 06:23 · PVG 14:23 · LAX 23:23 · JFK 02:23
    ♥ Do have faith in what you're doing.