
    Rǻi                        d dl mZ ddlmZ ddlmZ ddlmZm	Z	m
Z
mZ ej                  r
d dlZddlmZ  G d d	e      Zy)
    )annotations   )_typing)Lock)ConfigTrustAllTrustCustomCAsTrustSystemCAsN)ClientCertificatec                       e Zd ZU dZdZdZdZdZdZdZ	dZ
 e       ZdZdZdZdZdZdZdZdZded	<   d
ed<   d fdZddZ xZS )
PoolConfigzConnection pool configuration.i  Nd   g      >@FTssl.SSLContext | None_ssl_context_cacher   _ssl_context_cache_lockc                P    t        |   |i | d | _        t               | _        y )N)super__init__r   r   r   )selfargskwargs	__class__s      P/opt/lhia/marcimex/agent/venv/lib/python3.12/site-packages/neo4j/_sync/config.pyr   zPoolConfig.__init__o   s'    $)&)"&'+v$    c                    | j                   | j                   S | j                  sy d }| j                  5  | j                  R| j                  | j                  cd d d        S | j                  j                         }|;| j                  cd d d        S | j                  | j                  j                         }dd l} |j                  |j                        }|j                  j                  |_        t        | j                  t              rd|_        |j                   |_        nt        | j                  t$              rEd|_        |j&                  |_        | j                  j(                  D ]  }|j+                  |        n(d|_        |j&                  |_        |j-                          |2|j/                  |j0                  |j2                  |j4                         || _        |cd d d        S # 1 sw Y   y xY w)Nr   FT)keyfilepassword)ssl_context	encryptedr   r   client_certificateget_certificatessl
SSLContextPROTOCOL_TLS_CLIENT
TLSVersionTLSv1_2minimum_version
isinstancetrusted_certificatesr   check_hostname	CERT_NONEverify_moder	   CERT_REQUIREDcertsload_verify_locationsload_default_certsload_cert_chaincertfiler   r   )r   client_certr"   r   certs        r   get_ssl_contextzPoolConfig.get_ssl_contextt   s   '###~~04 )) ;	&&2**222;	 ;	 #55EEG&22;	 ;	 ((4"55EEG )#..)@)@AK +...*@*@K'$33X>-2**---'D55~F-1**-*;*;' 55;; <D55d;<
 .2**-*;*;' ..0&++(('//(11 ,  '2D#w;	 ;	 ;	s   $G4"'G4EG44G=)returnNone)r6   r   )__name__
__module____qualname____doc__max_connection_lifetimeliveness_check_timeoutmax_connection_pool_sizeconnection_timeoutconnection_write_timeoutresolverr   r
   r)   r    r   
user_agent
keep_aliveauthnotifications_min_severity&notifications_disabled_classificationstelemetry_disabled__annotations__r   r5   __classcell__)r   s   @r   r   r   #   s    ( # "  #
 
  $ H I
 *+  K J J D "& .2* --!!.
Er   r   )
__future__r    r   t_async_compat.concurrencyr   _confr   r   r	   r
   TYPE_CHECKINGr"   _auth_managementr   r    r   r   <module>rR      s7   " #  ,  ??4V Vr   