SeaHOH / GotoX

本地自动代理,修改自 goagent。
722 stars 147 forks source link

在Ubuntu上运行产生报错 #264

Closed Kenxu2022 closed 1 year ago

Kenxu2022 commented 1 year ago

在Ubuntu 20.04上使用conda创建一个python虚拟环境,运行start.py产生以下报错:

17:13:08 W [picker gws] 当前 gws IP 数量为 0
Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
  File "/home/ken/GotoX/local/HTTPUtil.py", line 737, in _create_ssl_connection
    ssl_sock.do_handshake()
  File "/home/ken/GotoX/local/compat/openssl.py", line 85, in do_handshake
    if session is None or not self.session_reused():
                              ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ken/GotoX/local/compat/openssl.py", line 67, in session_reused
    return SSL._lib.SSL_session_reused(self._ssl) == 1
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'lib' has no attribute 'SSL_session_reused'
2023-05-20T09:13:16Z <Greenlet at 0x7f9c91f74a40: <bound method HTTPUtil._create_ssl_connection of <local.HTTPUtil.HTTPUtil object at 0x7f9c91ea4390>>(('(IP地址)', 443), 'cloudflare_workers|:443', '(cfw域名)', <queue.Queue object at 0x7f9c91edbd10>, None, <function HTTPUtil.create_ssl_connection.<locals>.)> failed with AttributeError

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
  File "/home/ken/GotoX/local/HTTPUtil.py", line 737, in _create_ssl_connection
    ssl_sock.do_handshake()
  File "/home/ken/GotoX/local/compat/openssl.py", line 85, in do_handshake
    if session is None or not self.session_reused():
                              ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ken/GotoX/local/compat/openssl.py", line 67, in session_reused
    return SSL._lib.SSL_session_reused(self._ssl) == 1
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'lib' has no attribute 'SSL_session_reused'
2023-05-20T09:13:16Z <Greenlet at 0x7f9c91f74680: <bound method HTTPUtil._create_ssl_connection of <local.HTTPUtil.HTTPUtil object at 0x7f9c91ea4390>>(('(IP地址)', 443), 'cloudflare_workers|:443', '(cfw域名)', <queue.Queue object at 0x7f9c91edbd10>, None, <function HTTPUtil.create_ssl_connection.<locals>.)> failed with AttributeError

17:14:08 W [picker gws] 当前 gws IP 数量为 0
17:15:00 E [picker gws] pick_ip_worker 发生错误:module 'lib' has no attribute 'SSL_session_reused'
Traceback (most recent call last):
  File "/home/ken/GotoX/local/GIPManager.py", line 962, in pick_ip_worker
    domain, ssl_time, type = self.get_ip_info(ip)
                             ^^^^^^^^^^^^^^^^^^^^
  File "/home/ken/GotoX/local/GIPManager.py", line 846, in get_ip_info
    ssl_sock.do_handshake()
  File "/home/ken/GotoX/local/compat/openssl.py", line 85, in do_handshake
    if session is None or not self.session_reused():
                              ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ken/GotoX/local/compat/openssl.py", line 67, in session_reused
    return SSL._lib.SSL_session_reused(self._ssl) == 1
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'lib' has no attribute 'SSL_session_reused'

GotoX为最新版 python版本是3.11.3 已安装以下包:

brotlicffi     1.0.9.2
cffi           1.15.1
cryptography   40.0.2
dnslib         0.9.23
gevent         22.10.2
greenlet       2.0.2
pip            23.0.1
pycparser      2.21
pyOpenSSL      23.1.1
PySocks        1.7.1
setuptools     66.0.0
wheel          0.38.4
zope.event     4.6
zope.interface 6.0
SeaHOH commented 1 year ago

如果你急着现在要用,cryptography 降到 v39 就行。

嗯,其实上个月 cryptography 更新后就一直这样,清理了许多 pyOpenSSL 未用到的 API。我已经申请恢复了另一个更关键的 SSL_CTX_set_cert_store,但 pyOpenSSL 并未立即添加并释出新版,为避免后续对方可能失约就没有立即修复。不过既然已经有人提出,明天就发布修复。

Kenxu2022 commented 1 year ago

好的,非常感谢😉