本文整理汇总了Python中cryptography.utils.CryptographyDeprecationWarning方法的典型用法代码示例。如果您正苦于以下问题:Python utils.CryptographyDeprecationWarning方法的具体用法?Python utils.CryptographyDeprecationWarning怎么用?Python utils.CryptographyDeprecationWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cryptography.utils
的用法示例。
在下文中一共展示了utils.CryptographyDeprecationWarning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _verify_openssl_version
# 需要导入模块: from cryptography import utils [as 别名]
# 或者: from cryptography.utils import CryptographyDeprecationWarning [as 别名]
def _verify_openssl_version(lib):
if (
lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
not lib.CRYPTOGRAPHY_IS_LIBRESSL
):
if os.environ.get("CRYPTOGRAPHY_ALLOW_OPENSSL_101"):
warnings.warn(
"OpenSSL version 1.0.1 is no longer supported by the OpenSSL "
"project, please upgrade. The next version of cryptography "
"will completely remove support for it.",
utils.CryptographyDeprecationWarning
)
else:
raise RuntimeError(
"You are linking against OpenSSL 1.0.1, which is no longer "
"supported by the OpenSSL project. You need to upgrade to a "
"newer version of OpenSSL."
)
示例2: _verify_openssl_version
# 需要导入模块: from cryptography import utils [as 别名]
# 或者: from cryptography.utils import CryptographyDeprecationWarning [as 别名]
def _verify_openssl_version(lib):
if (
lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
not lib.CRYPTOGRAPHY_IS_LIBRESSL
):
warnings.warn(
"OpenSSL version 1.0.1 is no longer supported by the OpenSSL "
"project, please upgrade. The next version of cryptography will "
"drop support for it.",
utils.CryptographyDeprecationWarning
)
示例3: _verify_openssl_version
# 需要导入模块: from cryptography import utils [as 别名]
# 或者: from cryptography.utils import CryptographyDeprecationWarning [as 别名]
def _verify_openssl_version(lib):
if (
lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
not lib.CRYPTOGRAPHY_IS_LIBRESSL
):
warnings.warn(
"OpenSSL version 1.0.1 is no longer supported by the OpenSSL "
"project, please upgrade. A future version of cryptography will "
"drop support for it.",
utils.CryptographyDeprecationWarning
)