rationa1cuzz
V2EX  ›  问与答

请教一个 requests https 的问题

  •  
  •   rationa1cuzz · Jul 31, 2023 · 1331 views
    This topic created in 1192 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
    1d074bfa18d34f6c
    Jul 31, 2023
    1
    加个 Request header 试下?
    shanghai1943
    shanghai1943
    Jul 31, 2023
    2
    换成 域名+免费 ssl 证书 试试?
    rationa1cuzz
    rationa1cuzz
    OP
    Aug 1, 2023
    3
    @1d074bfa18d34f6c 试过了,把浏览器的头全拷过去都不行
    @shanghai1943 太麻烦,实在不行再试试免费证书吧
    1d074bfa18d34f6c
    1d074bfa18d34f6c
    Aug 1, 2023
    4
    @rationa1cuzz 这个是需求是爬虫吗?可以试试 selenium
    rationa1cuzz
    rationa1cuzz
    OP
    Aug 1, 2023
    5
    @1d074bfa18d34f6c 有一点点像,没必要上那么重的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2420 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:36 · PVG 23:36 · LAX 07:36 · JFK 10:36
    ♥ Do have faith in what you're doing.