吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 661|回复: 2
收起左侧

[求助] [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1006)'))

[复制链接]
vistal 发表于 2024-9-7 20:54
本帖最后由 vistal 于 2024-9-7 20:58 编辑

请问各位大佬 有什么问题可以解决 [size=1em]  只能降级Python吗?试过安装requests==2.25.1   urllib3==1.25.11 故障依旧  G站和度娘 还有通义都问过了,目前还没有答案  所以来请教各位大佬
[size=1em]File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 670, in urlopen    httplib_response = self._make_request(                       ^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 381, in _make_request    self._valIDAte_conn(conn)  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn    conn.connect()  File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 362, in connect    self.sock = ssl_wrap_socket(                ^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/urllib3/util/ssl_.py", line 386, in ssl_wrap_socket    return context.wrap_socket(sock, server_hostname=server_hostname)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/ssl.py", line 517, in wrap_socket    return self.sslsocket_class._create(           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/ssl.py", line 1104, in _create    self.do_handshake()  File "/usr/local/lib/python3.11/ssl.py", line 1382, in do_handshake    self._sslobj.do_handshake()ssl.SSLError: [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1006)During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 439, in send    resp = conn.urlopen(           ^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 726, in urlopen    retries = retries.increment(              ^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 446, in increment    raise MaxRetryError(_pool, url, error or ResponseError(cause))urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='wapside.xxx.cn', port=9001): Max retries exceeded with url: /jt-sign/ssoHomLogin?ticket=5d8042e745c167ed850fbd12014fe6bcbbf4a913e82fe3c3e6025f0a689cdc5d4e75da84110d7cc817d2ad503565e56d220045c5d82b71e0131aab244b803f94267566f7b1a313c5452f7bc3f39cdc785e7c4104885150a3cfc441d51a57d68e (Caused by SSLError(SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1006)')))During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "/ql/data/scripts/dx/dx2.py", line 142, in <module>    telecom.main()  File "/ql/data/scripts/dx/dx2.py", line 114, in main    self.init()  File "/ql/data/scripts/dx/dx2.py", line 55, in init    self.sign = self.getSign(self.ticket)                ^^^^^^^^^^^^^^^^^^^^^^^^^  File "/ql/data/scripts/dx/dx2.py", line 48, in getSign    resp = get(url=url, params=data).json()           ^^^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 76, in get    return request('get', url, params=params, **kwargs)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 61, in request    return session.request(method=method, url=url, **kwargs)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 542, in request    resp = self.send(prep, **send_kwargs)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 655, in send    r = adapter.send(request, **kwargs)        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 514, in send    raise SSLError(e, request=request)requests.exceptions.SSLError: HTTPSConnectionPool(host='wapside.xxxcn', port=9001): Max retries exceeded with url: /jt-sign/ssoHomLogin?ticket=5d8042e745c167ed850fbd12014fe6bcbbf4a913e82fe3c3e6025f0a689cdc5d4e75da84110d7cc817d2ad503565e56d220045c5d82b71e0131aab244b803f94267566f7b1a313c5452f7bc3f39cdc785e7c4104885150a3cfc441d51a57d68e (Caused by SSLError(SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1006)')))

免费评分

参与人数 1吾爱币 +1 收起 理由
adam717 + 1 怎么解决的?

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

wuaipojie_lbw 发表于 2024-9-8 14:20
这两种方式你可以试下
1、更新库和Python版本:确保你使用的是最新版本的requests、urllib3和Python。新版本通常包含对更强大安全协议的支持。

2、指定更高的加密密钥:你可以通过设置默认密码字符串来避免使用弱DH密钥。例如:
import requests
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL'
response = requests.get('https://example.com')
print(response.content)
 楼主| vistal 发表于 2024-9-8 17:00
wuaipojie_lbw 发表于 2024-9-8 14:20
这两种方式你可以试下
1、更新库和Python版本:确保你使用的是最新版本的requests、urllib3和Python。新版 ...

谢谢我试试
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-13 02:53

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表