|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/google/auth/transport/__pycache__/ |
U
O��g� � @ s8 d Z ddlmZ ddlmZ dd� Zdd� Zdd � Zd
S )zUtilites for mutual TLS.� )�
exceptions)�_mtls_helperc C s, t �t j�dk rdS t �t j�dk r(dS dS )z�Check if default client SSL credentials exists on the device.
Returns:
bool: indicating if the default client cert source exists.
NTF)r Z_check_config_pathZCONTEXT_AWARE_METADATA_PATHZ&CERTIFICATE_CONFIGURATION_DEFAULT_PATH� r r �G/opt/cppython/lib/python3.8/site-packages/google/auth/transport/mtls.py�has_default_client_cert_source s
�����r c C s t � st�d��dd� } | S )a� Get a callback which returns the default client SSL credentials.
Returns:
Callable[[], [bytes, bytes]]: A callback which returns the default
client certificate bytes and private key bytes, both in PEM format.
Raises:
google.auth.exceptions.DefaultClientCertSourceError: If the default
client SSL credentials don't exist or are malformed.
z(Default client cert source doesn't existc
S sT zt �� \} }}W n8 tttfk
rJ } zt�|�}||�W 5 d }~X Y nX ||fS )N)r Zget_client_cert_and_key�OSError�RuntimeError�
ValueErrorr �MutualTLSChannelError)�_�
cert_bytes� key_bytes�
caught_exc�new_excr r r �callback: s
z,default_client_cert_source.<locals>.callback�r r r
)r r r r �default_client_cert_source* s � r c s"