当前位置: 首页>>代码示例>>Python>>正文


Python utils.CryptographyDeprecationWarning方法代码示例

本文整理汇总了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."
            ) 
开发者ID:tp4a,项目名称:teleport,代码行数:20,代码来源:binding.py

示例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
        ) 
开发者ID:wistbean,项目名称:learn_python3_spider,代码行数:13,代码来源:binding.py

示例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
        ) 
开发者ID:aws-quickstart,项目名称:quickstart-redhat-openshift,代码行数:13,代码来源:binding.py


注:本文中的cryptography.utils.CryptographyDeprecationWarning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。