【问题标题】:Python Requests SSL Error 504Python 请求 SSL 错误 504
【发布时间】:2015-05-25 12:29:15
【问题描述】:

我正在尝试使用请求连接到登录页面(https 页面)。 我的代码:

import requests
requests.get('https page')

这仍然返回:

SSLError: [Errno 1] _ssl.c:504: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error

我设置了verify=False,但它仍然返回相同的错误。

【问题讨论】:

    标签: python ssl


    【解决方案1】:

    像这样安装请求模块。这将安装额外的安全包。

    pip install requests[security]
    

    【讨论】:

      【解决方案2】:

      服务器需要SNI (server name indication),如果不使用 SNI 扩展,将引发 TLS 警报。 SNI 可用于 python 3 和 python 2.7.9+。对于旧版本的 python,请参阅using requests with TLS doesn't give SNI support

      【讨论】:

        猜你喜欢
        • 2018-11-01
        • 2015-08-30
        • 1970-01-01
        • 2022-08-12
        • 2018-04-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多