我在配置影子袜子配置文件时遇到了这个问题:
$ ssserver -c profile.json
/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/common.py:221: SyntaxWarning: "is" with a literal. Did you mean "=="?
if addr is "":
/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/common.py:233: SyntaxWarning: "is" with a literal. Did you mean "=="?
if len(block) is 1:
/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/common.py:235: SyntaxWarning: "is not" with a literal. Did you mean "!="?
while (ip & 1) == 0 and ip is not 0:
INFO: loading config from profile.json
Traceback (most recent call last):
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/bin/.ssserver-real", line 11, in <module>
load_entry_point('shadowsocks==3.0.0', 'console_scripts', 'ssserver')()
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/server.py", line 34, in main
config = shell.get_config(False)
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/shell.py", line 355, in get_config
check_config(config, is_local)
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/shell.py", line 210, in check_config
cryptor.try_cipher(config['password'], config['method'],
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/cryptor.py", line 51, in try_cipher
Cryptor(key, method, crypto_path)
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/cryptor.py", line 98, in __init__
self.cipher = self.get_cipher(
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/cryptor.py", line 130, in get_cipher
return m[METHOD_INFO_CRYPTO](method, key, iv, op, self.crypto_path)
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/crypto/openssl.py", line 150, in __init__
OpenSSLCryptoBase.__init__(self, cipher_name, crypto_path)
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/crypto/openssl.py", line 98, in __init__
load_openssl(crypto_path)
File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/crypto/openssl.py", line 51, in load_openssl
raise Exception('libcrypto(OpenSSL) not found with path %s' % path)
Exception: libcrypto(OpenSSL) not found with path None解决办法是什么?
发布于 2020-12-07 15:30:51
有人,他比我写这篇文章时更好地看了源代码,他设计了一块地,并提交给了上游的Guix。换句话说,这个问题可能很快就会得到解决。
看一下“影子袜子”的包定义,它看上去相当空洞,甚至没有将OpenSSL作为输入或任何类似的东西列出。此外,似乎“影子袜子”希望您将所有这些路径保存在某种配置中。
config['crypto_path'] = {'openssl': config['libopenssl'],
'mbedtls': config['libmbedtls'],
'sodium': config['libsodium']}这些技巧在传统发行版(如基于Debian等人的发行版)上可能非常聪明,但是当与任何类型的功能包管理一起使用时,它们就彻底崩溃了。处理这类问题的Guix方法是在构建时使用substitute*对输入路径进行硬编码。您的阶段可能如下所示:
(add-after 'unpack 'patch-crypto-paths
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "shadowsocks/shell.py"
(("config\\['libopenssl'\\]")
(string-append (assoc-ref inputs "openssl") "/path/to/libopenssl"))
[...])
#t))由于上面的代码显然是Guix代码,所以您可以在GPLv3+下自由地使用它,即使这样通常也会强制CC SA.
请注意,最近可能不再严格要求以#t结尾,但我认为您仍然可以在Guix代码中找到它。
https://unix.stackexchange.com/questions/623324
复制相似问题