when someone abandons you,it is him that gets loss because he lost someone who truly loves him but you just lost one who doesn’t love you.
问题描述:
本文适用于解决 openssl 升级到 1.1.0 以上版本,导致 shadowsocks2.8.2 启动报 undefined symbol: EVP_CIPHER_CTX_cleanup 错误
解决方法:
最近将 openssl 升级到了 1.1.0b 版本,编译之后 shadowsocks 无法启动,报错如下:
1 | Traceback (most recent call last): |
这个问题是由于在 openssl1.1.0 版本中,废弃了 EVP_CIPHER_CTX_cleanup 函数,如官网中所说:
EVP_CIPHER_CTX was made opaque in OpenSSL 1.1.0. As a result, EVP_CIPHER_CTX_reset() appeared and EVP_CIPHER_CTX_cleanup() disappeared. EVP_CIPHER_CTX_init() remains as an alias for EVP_CIPHER_CTX_reset().
EVP_CIPHER_CTX_reset 函数替代了 EVP_CIPHER_CTX_cleanup 函数
EVP_CIPHER_CTX_reset 函数说明:
EVP_CIPHER_CTX_reset() clears all information from a cipher context and free up any allocated memory associate with it, except the ctx itself. This function should be called anytime ctx is to be reused for another EVP_CipherInit() / EVP_CipherUpdate() / EVP_CipherFinal() series of calls.
EVP_CIPHER_CTX_cleanup 函数说明:
EVP_CIPHER_CTX_cleanup() clears all information from a cipher context and free up any allocated memory associate with it. It should be called after all operations using a cipher are complete so sensitive information does not remain in memory.
可以看出,二者功能基本上相同,都是释放内存,只是应该调用的时机稍有不同,所以用 reset 代替 cleanup 问题不大。
修改方法:
提示:
所以如果决定使用 openssl1.1.0 需要考虑很多兼容问题,必须保留 1.0.2 或 1.0.1(不推荐,存在一些已知漏洞,最重要的是如果服务器要开 http2,由于新版 chrome 必须使用 ALPN 的限制,只有 1.0.2 版本支持 ALPN,所以必须升级到 1.0.2)版本以便编译其他程序。
either I will find a way, or I will make one.