| Server IP : 159.223.102.202 / Your IP : 216.73.216.195 Web Server : nginx/1.26.0 System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : albasshbotta ( 1021) PHP Version : 8.2.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/service_identity/__pycache__/ |
Upload File : |
�
զe � �� � d Z ddlmZ ddlZddlmZ ddlmZmZm Z m
Z
mZmZm
Z
ddlmZ ddlmZ ddlmZ d d
lmZ d dlmZmZmZmZmZmZmZmZ dgZ dd
�Z dd�Z! ed� Z"dd�Z#dd�Z$y)zL
`cryptography.x509 <https://github.com/pyca/cryptography>`_-specific code.
� )�annotationsN)�Sequence)�Certificate�DNSName�ExtensionOID� IPAddress�ObjectIdentifier� OtherName�UniformResourceIdentifier)�ExtensionNotFound)�decode)� IA5String� )�CertificateError)�DNS_ID�CertificatePattern�
DNSPattern�IPAddress_ID�IPAddressPattern�
SRVPattern�
URIPattern�verify_service_identity�verify_certificate_hostnamec �F � t t | � t |� gg �� y)a�
Verify whether *certificate* is valid for *hostname*.
.. note::
Nothing is verified about the *authority* of the certificate;
the caller must verify that the certificate chains to an appropriate
trust root themselves.
Args:
certificate: A *cryptography* X509 certificate object.
hostname: The hostname that *certificate* should be valid for.
Raises:
service_identity.VerificationError:
If *certificate* is not valid for *hostname*.
service_identity.CertificateError:
If *certificate* contains invalid / unexpected data. This includes
the case where the certificate contains no `subjectAltName`\ s.
.. versionchanged:: 24.1.0
:exc:`~service_identity.CertificateError` is raised if the certificate
contains no ``subjectAltName``\ s instead of
:exc:`~service_identity.VerificationError`.
��
cert_patterns�obligatory_ids�optional_idsN)r �extract_patternsr )�certificate�hostnames �?/usr/lib/python3/dist-packages/service_identity/cryptography.pyr r ( s"