报错
RuntimeError: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.
解决办法
OpenSSL 3.0加载失败: 此错误表明 cryptography 库试图加载OpenSSL 3.0的遗留提供程序,但失败了。错误建议通过设置环境变量 CRYPTOGRAPHY_OPENSSL_NO_LEGACY 来禁用遗留算法。如果你不需要使用遗留算法,可以通过以下方式在运行脚本之前设置环境变量:
export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1
或者,如果你确实需要遗留算法,这可能表明你的OpenSSL配置有误。