![python:此版本的 OpenSSL 不支持 X25519](https://linux22.com/image/1589690/python%EF%BC%9A%E6%AD%A4%E7%89%88%E6%9C%AC%E7%9A%84%20OpenSSL%20%E4%B8%8D%E6%94%AF%E6%8C%81%20X25519.png)
我尝试执行 python 应用程序(yowsup)注册请求并收到错误:
...
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/asymmetric/x25519.py", line 42, in generate
_Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
cryptography.exceptions.UnsupportedAlgorithm: X25519 is not supported by this version of OpenSSL.
我获得了最新版本的 openssl:
wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1b.tar.gz
取消存档并配置:
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
然后:
make && make test && make install
修复了操作系统和检查版本中的链接:
openssl version -a
OpenSSL 1.1.1b 26 Feb 2019
built on: Sat Apr 27 14:42:16 2019 UTC
platform: linux-armv4
options: bn(64,32) rc4(char) des(long) idea(int) blowfish(ptr)
compiler: gcc -fPIC -pthread -march=armv7-a -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DZLIB -DNDEBUG
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/usr/local/ssl/lib/engines-1.1"
Seeding source: os-specific
之后我获得了最新的 pythone 2.7 并重新编译它以使用系统 openssl:
export LDFLAGS="-L/usr/local/ssl/lib/"
export LD_LIBRARY_PATH="/usr/local/ssl/lib/"
export CPPFLAGS="-I/usr/local/ssl/include -I/usr/local/ssl/include/openssl"
$ ./configure --prefix=/path/to/custom/python/ --enable-optimizations
make && make install
修复链接然后尝试:
root@orangepiplus2e:~# python -V
Python 2.7.16
然后使用 python 的 open ssl 检查:
root@orangepiplus2e:~# python -c "import ssl; print(ssl.OPENSSL_VERSION)"
OpenSSL 1.1.1b 26 Feb 2019
但它仍然不起作用,我的操作系统:
root@orangepiplus2e:/etc/ld.so.conf.d# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial