File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/google/auth/transport/__pycache__/mtls.cpython-310.pyc
Back
o �h� � @ s8 d Z ddlmZ ddlmZ dd� Zdd� Zdd � Zd S )zUtilites for mutual TLS.� )� exceptions)�_mtls_helperc C s t �t j�} | duS )z�Check if default client SSL credentials exists on the device. Returns: bool: indicating if the default client cert source exists. N)r �_check_dca_metadata_path�CONTEXT_AWARE_METADATA_PATH)� metadata_path� r �P/usr/local/CyberPanel/lib/python3.10/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 sH zt �� \} }}W ||fS tttfy# } zt�|�}||�d }~ww )N)r �get_client_cert_and_key�OSError�RuntimeError� ValueErrorr �MutualTLSChannelError)�_� cert_bytes� key_bytes� caught_exc�new_excr r r �callback1 s � ��z,default_client_cert_source.<locals>.callback�r r r )r r r r �default_client_cert_source! s � r c s"