Pyhton requests.post raise error SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)')

huangapple go评论88阅读模式
英文:

Pyhton requests.post raise error SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)')

问题

我尝试了这个解决方案,但它没有起作用。

我正在以以下形式进行POST请求:

res = requests.post(
            url, data=json.dumps(data), headers=self.headers, verify=False
        )

但我得到了SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)')

我正在使用Python 3.10,其中包括:

  • pyOpenSSL 23.2.0
  • requests 2.31.0

我尝试了以下操作:

>>> import ssl
>>> print(ssl.OPENSSL_VERSION)
OpenSSL 1.1.1n  15 Mar 2022

执行openssl s_client -connect 10.10.96.28:443时出现以下情况:

SSL握手已读取1010字节并写入611字节
验证错误:自签名证书
---
新的,TLSv1.2,密码是AES256-GCM-SHA384
服务器公钥为2048位
支持安全重新协商
压缩:无
扩展:无
没有ALPN协商
SSL会话:
    协议  : TLSv1.2
    密码    : AES256-GCM-SHA384

在Python 3.9中一切正常。

英文:

I've tried this solution but it didn't work

I'm doing a POST requests in the form of

res = requests.post(
            url, data=json.dumps(data), headers=self.headers, verify=False
        )

But I'm getting SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)')

I'm using pyhton 3.10 with

  • pyOpenSSL 23.2.0
  • requests 2.31.0

I've tried

>>> import ssl
>>> print(ssl.OPENSSL_VERSION)
OpenSSL 1.1.1n  15 Mar 2022

Doing openssl s_client -connect 10.10.96.28:443

SSL handshake has read 1010 bytes and written 611 bytes
Verification error: self signed certificate
---
New, TLSv1.2, Cipher is AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : AES256-GCM-SHA384

Everything works in Python 3.9

答案1

得分: 0

有一个问题出现在该库中,已经修复。

https://github.com/JurajNyiri/pytapo/issues/65#issuecomment-1656470805

英文:

There was an issue with the library that has been fixed

https://github.com/JurajNyiri/pytapo/issues/65#issuecomment-1656470805

huangapple
  • 本文由 发表于 2023年7月20日 17:56:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76728698.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定