How to silence EllipticCurvePublicNumbers.encode_point CryptographyDeprecationWarning when using Paramiko in Python

女生的网名这么多〃 提交于 2019-11-27 06:51:07

问题


CryptographyDeprecationWarning:

encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.


回答1:


This has been fixed in Paramiko 2.5.0 already:
https://www.paramiko.org/changelog.html#2.5.0
https://github.com/paramiko/paramiko/pull/1379
https://github.com/paramiko/paramiko/issues/1369




回答2:


I've had better success with:

import warnings
warnings.simplefilter("ignore", cryptography.utils.DeprecatedIn23)


来源:https://stackoverflow.com/questions/54861026/how-to-silence-ellipticcurvepublicnumbers-encode-point-cryptographydeprecationwa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!