+
    8i@                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RI	t
^ RIHt ^ RIHt ^ RIHtHtHtHtHtHt ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RI H!t" ^ R	I H#t# ^ R
I$H%t% ^ RI&H't' ^ RI(H)t* ^ RI(H+t+ ^ RI,H-t- ]'       d   ^ RIH.t. ]! R4      t/ ^ RI0t0Rt1]Pf                  t4]Pj                  t5]Pl                  t6]Pn                  t7]8! ]R^ 4      t9Rt:Rt;]Px                  t=]P|                  ]P~                  ]P                  ]P                  ]P                  ]P                  ]P                  ,          /tD]DP                  4        U Uu/ uF  w  rWbK	  	  upp tFR R ltG]P                  ]P                  ]P                  3tK]P                  tL]P                  tM]P                  tNR R ltO ! R R]P                  4      tQ ! R R4      tR ! R R4      tSR#   ]2 d    Rt1 ELMi ; iu upp i )zA CPython compatible SSLContext implementation wrapping PyOpenSSL's
context.

Due to limitations of the CPython asyncio.Protocol implementation for SSL, the async API does not support PyOpenSSL.
)annotationsN)EINTR)
ip_address)TYPE_CHECKINGAnyCallableOptionalTypeVarUnion)SSL)crypto)ConfigurationError)_CertificateError)
_OCSPCache)_ocsp_callback)SocketChecker)_errno_from_exception)validate_boolean)
VerifyMode_TTFOP_NO_RENEGOTIATIONc                    V ^8  d   QhRRRR/# )   addressr   returnbool )formats   "W/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pymongo/pyopenssl_context.py__annotate__r   S   s      C D     c                N     \        V 4       R #   \        \        3 d     R# i ; i)TF)_ip_address
ValueErrorUnicodeError)r   s   &r   _is_ip_addressr%   S   s)    G% s    $$c                    V ^8  d   QhRRRR/# )r   excBaseExceptionr   r   r   )r   s   "r   r   r   c   s     . .] .t .r    c                     V P                   R8H  # )z<Return True if the OpenSSL.SSL.SysCallError is a ragged EOF.)zUnexpected EOF)args)r'   s   &r   _ragged_eofr,   c   s    88---r    c                     a  ] tR t^ktR V 3R lltR R ltR V 3R lltR V 3R lltR	 V 3R
 lltRR V 3R lllt	Rt
V ;t# )_sslConnc               $    V ^8  d   QhRRRRRR/# )r   ctxz_SSL.ContextsockzOptional[_socket.socket]suppress_ragged_eofsr   r   )r   s   "r   r   _sslConn.__annotate__l   s(     $ $$ '$ #	$r    c                	P   < \        4       V n        W0n        \        SV `  W4       R # N)_SocketCheckersocket_checkerr2   super__init__)selfr0   r1   r2   	__class__s   &&&&r   r9   _sslConn.__init__l   s#     -.$8!#r    c               (    V ^8  d   QhRRRRRRRR/# )r   callzCallable[..., _T]r+   r   kwargsr   r   r   )r   s   "r   r   r3   v   s)      + C 3 2 r    c                	   V P                  4       pV'       d   \        P                  ! 4       p  V! V/ VB #   \         Ed!   pT^ 8X  d   ThT P	                  4       R8X  dM   T'       d9   \        P                  ! 4       X,
          T8  d   \
        P                  ! R4      Rh\        R4      Rh\        T\        P                  4      '       d   R pRpM)\        T\        P                  4      '       d   RpR pMR pR pT P                  P                  YY4       T'       d9   \        P                  ! 4       X,
          T8  d   \
        P                  ! R4      Rh Rp?EK1  Rp?ii ; i)Tz	timed outNz!Underlying socket has been closedFr*   )
gettimeout_time	monotonicBLOCKING_IO_ERRORSfileno_sockettimeoutSSLError
isinstance_SSLWantReadErrorWantWriteErrorr7   select)	r:   r>   r+   r?   rG   startr'   	want_read
want_writes	   &&*,     r   _call_sslConn._callv   s   //#OO%ET,V,,% a<I;;=B&5??#4u#<w#F%ook:D"#FGTQc4#5#566 $I!&JT%8%899 %I!%J $I!%J##**4JPu0587B!//+6D@+s   8 E$%E*C.EE$c               $    V ^8  d   QhRRRRRR/# )r   r+   r   r?   r   Noner   )r   s   "r   r   r3      s&     A A# A A Ar    c                	@   < V P                   ! \        SV `  .VO5/ VB # r5   )rQ   r8   do_handshake)r:   r+   r?   r;   s   &*,r   rV   _sslConn.do_handshake   s!    zz%'.@@@@r    c               $    V ^8  d   QhRRRRRR/# )r   r+   r   r?   r   bytesr   )r   s   "r   r   r3      s!      #   r    c                	   <  V P                   ! \        SV `  .VO5/ VB #   \        P                   d0   pT P
                  '       d   \        T4      '       d    R p?R# h R p?ii ; i)Nr    )rQ   r8   recvrJ   SysCallErrorr2   r,   r:   r+   r?   r'   r;   s   &*, r   r[   _sslConn.recv   sW    	::egl<T<V<<   	((([-=-=		   ! A%#A A  A%c               $    V ^8  d   QhRRRRRR/# )r   r+   r   r?   r   intr   )r   s   "r   r   r3      s!      s c c r    c                	   <  V P                   ! \        SV `  .VO5/ VB #   \        P                   d0   pT P
                  '       d   \        T4      '       d    R p?^ # h R p?ii ; ir5   )rQ   r8   	recv_intorJ   r\   r2   r,   r]   s   &*, r   rc   _sslConn.recv_into   sX    	::eg/A$A&AA   	((([-=-=		r_   c               $    V ^8  d   QhRRRRRR/# )r   bufrY   flagsra   r   rT   r   )r   s   "r   r   r3      s!      5  T r    c                	  < \        V4      p\        V4      p^ pWT8  d;    V P                  \        SV `  W5R V4      pT^ 8:  d   \        R4      hYV,          pK@  R#   \
         d!   p\        T4      \        8X  d    Rp?Kg  h Rp?ii ; i)    Nzconnection closed)
memoryviewlenrQ   r8   sendOSErrorr   _EINTR)	r:   rf   rg   viewtotal_length
total_sentsentr'   r;   s	   &&&     r   sendall_sslConn.sendall   s    #3x
'zz%',[0A5I qy122J (  (-7s   A B'BBB)r7   r2   ri   )__name__
__module____qualname____firstlineno__r9   rQ   rV   r[   rc   rs   __static_attributes____classcell__)r;   s   @r   r.   r.   k   sA    $ $<A A    r    r.   c                  &    ] tR t^tRtR R ltRtR# )_CallbackDataz0Data class which is passed to the OCSP callback.c                   V ^8  d   QhRR/# r   r   rT   r   )r   s   "r   r   _CallbackData.__annotate__   s     0 0$ 0r    c                	@    R V n         R V n        \        4       V n        R # r5   )trusted_ca_certscheck_ocsp_endpointr   ocsp_response_cacher:   s   &r   r9   _CallbackData.__init__   s    BF37 #-< r    )r   r   r   N)rv   rw   rx   ry   __doc__r9   rz   r   r    r   r}   r}      s    :0 0r    r}   c                  H   ] tR t^tRtR&tR R lt]R R l4       tR R lt	R R	 lt
]! ]	]
4      tR
 R ltR R lt]! ]]4      tR R ltR R lt]! ]]4      tR R ltR R lt]! ]]4      tR'R R lltR'R R lltR R ltR R ltR R  ltR! R" ltR(R# R$ lltR%tR# ))
SSLContextzMA CPython compatible SSLContext implementation wrapping PyOpenSSL's
context.
c                   V ^8  d   QhRR/# )r   protocolra   r   )r   s   "r   r   SSLContext.__annotate__   s     
^ 
^ 
^r    c                	    Wn         \        P                  ! V P                   4      V n        \	        4       V n        R V n        R V P
                  n        V P                  P                  \        V P
                  R7       R# )T)callbackdataN)
	_protocolrJ   Context_ctxr}   _callback_data_check_hostnamer   set_ocsp_client_callbackr   )r:   r   s   &&r   r9   SSLContext.__init__   sZ    !LL0	+o#
 37/		**NI\I\*]r    c                   V ^8  d   QhRR/# r   r   ra   r   )r   s   "r   r   r      s      # r    c                    V P                   # )zXThe protocol version chosen when constructing the context.
This attribute is read-only.
)r   r   s   &r   r   SSLContext.protocol   s    
 ~~r    c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r      s     @ @: @r    c                L    \         V P                  P                  4       ,          # )zWhether to try to verify other peers' certificates and how to
behave if verification fails. This attribute must be one of
ssl.CERT_NONE, ssl.CERT_OPTIONAL or ssl.CERT_REQUIRED.
)_REVERSE_VERIFY_MAPr   get_verify_moder   s   &r   __get_verify_modeSSLContext.__get_verify_mode   s    
 #499#<#<#>??r    c                    V ^8  d   QhRRRR/# )r   valuer   r   rT   r   )r   s   "r   r   r      s     6 6z 6d 6r    c                `    R R lpV P                   P                  \        V,          V4       R# )zSetter for verify_mode.c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )r   _connobjz_SSL.Connection_x509objz_crypto.X509_errnumra   	_errdepthretcoder   r   r   )r   s   "r   r   2SSLContext.__set_verify_mode.<locals>.__annotate__   sD     	! 	!%	!"	! 	! 		!
 	! 	!r    c                    \        V4      # r5   )r   )r   r   r   r   r   s   &&&&&r   _cb)SSLContext.__set_verify_mode.<locals>._cb   s     = r    N)r   
set_verify_VERIFY_MAP)r:   r   r   s   && r   __set_verify_modeSSLContext.__set_verify_mode   s"    	!  			[/5r    c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r      s     $ $d $r    c                	    V P                   # r5   )r   r   s   &r   __get_check_hostnameSSLContext.__get_check_hostname   s    ###r    c                    V ^8  d   QhRRRR/# )r   r   r   r   rT   r   )r   s   "r   r   r     s     % %# %$ %r    c                	*    \        R V4       Wn        R# )check_hostnameN)r   r   r:   r   s   &&r   __set_check_hostnameSSLContext.__set_check_hostname  s    )51$r    c                   V ^8  d   QhRR/# )r   r   zOptional[bool]r   )r   s   "r   r   r     s     7 7> 7r    c                	.    V P                   P                  # r5   )r   r   r   s   &r   __get_check_ocsp_endpoint$SSLContext.__get_check_ocsp_endpoint  s    ""666r    c                    V ^8  d   QhRRRR/# )r   r   r   r   rT   r   )r   s   "r   r   r     s     8 8t 8 8r    c                	>    \        R V4       WP                  n        R# )
check_ocspN)r   r   r   r   s   &&r   __set_check_ocsp_endpoint$SSLContext.__set_check_ocsp_endpoint  s    u-27/r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s     ( (s (r    c                	8    V P                   P                  ^ 4      # ru   )r   set_optionsr   s   &r   __get_optionsSSLContext.__get_options  s     yy$$Q''r    c                    V ^8  d   QhRRRR/# )r   r   ra   r   rT   r   )r   s   "r   r   r     s     * *3 *4 *r    c                	N    V P                   P                  \        V4      4       R # r5   )r   r   ra   r   s   &&r   __set_optionsSSLContext.__set_options  s     			c%j)r    Nc               (    V ^8  d   QhRRRRRRRR/# )	r   certfilezUnion[str, bytes]keyfilezUnion[str, bytes, None]passwordOptional[str]r   rT   r   )r   s   "r   r   r     s2     % %#% )%  	%
 
%r    c                  a S'       d%   R V3R llpV P                   P                  V4       V P                   P                  V4       V P                   P                  T;'       g    T4       V P                   P	                  4        R# )a  Load a private key and the corresponding certificate. The certfile
string must be the path to a single file in PEM format containing the
certificate as well as any number of CA certificates needed to
establish the certificate's authenticity. The keyfile string, if
present, must point to a file containing the private key. Otherwise
the private key will be taken from certfile as well.
c               (    V ^8  d   QhRRRRRRRR/# )	r   _max_lengthra   _prompt_twicer   
_user_datazOptional[bytes]r   rY   r   )r   s   "r   r   0SSLContext.load_cert_chain.<locals>.__annotate__1  s)     0 03 0t 0 0]b 0r    c                2   < Sf   Q hSP                  R4      # )Nzutf-8)encode)r   r   r   r   s   &&&r   _pwcb)SSLContext.load_cert_chain.<locals>._pwcb1  s       +++w//r    N)r   set_passwd_cbuse_certificate_chain_fileuse_privatekey_filecheck_privatekey)r:   r   r   r   r   s   &&&f r   load_cert_chainSSLContext.load_cert_chain  sb      0 0 II##E*		,,X6		%%g&9&9:		""$r    c               $    V ^8  d   QhRRRRRR/# )r   cafiler   capathr   rT   r   )r   s   "r   r   r   =  s$     8 8#84A8	8r    c                <    V P                   P                  W4       R# )zLoad a set of "certification authority"(CA) certificates used to
validate other peers' certificates when `~verify_mode` is other than
ssl.CERT_NONE.
N)r   load_verify_locations)r:   r   r   s   &&&r   r    SSLContext.load_verify_locations=  s     			''7r    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   F  s     
 
t 
r    c                |    \         '       d'   V P                  \        P                  ! 4       4       R# \	        R4      h)z&Attempt to load CA certs from certifi.ztlsAllowInvalidCertificates is False but no system CA certificates could be loaded. Please install the certifi package, or provide a path to a CA file using the tlsCAFile optionN)_HAVE_CERTIFIr   certifiwhere_ConfigurationErrorr   s   &r   _load_certifiSSLContext._load_certifiF  s-    =&&w}}7%' r    c                    V ^8  d   QhRRRR/# )r   storestrr   rT   r   )r   s   "r   r   r   R  s      C D r    c                   V P                   P                  4       pVf   Q h\        P                  P                  P
                  p\        P                  ! V4       F_  w  rEpVR8X  g   K  VRJ g	   W69   g   K  VP                  \        P                  P                  \        P                  ! V4      4      4       Ka  	  R# )z2Attempt to load CA certs from Windows trust store.Nx509_asnT)r   get_cert_store
_stdlibsslPurposeSERVER_AUTHoidenum_certificatesadd_cert_cryptoX509from_cryptographyx509load_der_x509_certificate)r:   r   
cert_storer   certencodingtrusts   &&     r   _load_wincertsSSLContext._load_wincertsR  s    YY--/
%%%  ,,00%/%A%A%%H!DE:%D=CL''66t7U7UVZ7[\ &Ir    c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   _  s     - -D -r    c                (   \         P                  R8X  d    R F  pV P                  V4       K  	  M%\         P                  R8X  d   V P	                  4        V P
                  P                  4        R#   \         d    T P	                  4         L9i ; i)z7A PyOpenSSL version of load_default_certs from CPython.win32darwinN)CAROOT)_sysplatformr  	Exceptionr   r   set_default_verify_paths)r:   	storenames   & r   load_default_certsSSLContext.load_default_certs_  st    
 ==G#%!/I''	2 "0
 ]]h& 		**,  %""$%s   A3 3BBc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   o  s     - -$ -r    c                :    V P                   P                  4        R# )z]Specify that the platform provided CA certificates are to be used
for verification purposes.
N)r   r  r   s   &r   r  #SSLContext.set_default_verify_pathso  s     			**,r    c               4    V ^8  d   QhRRRRRRRRRRR	R
RR/# )r   r1   z_socket.socketserver_sider   do_handshake_on_connectr2   server_hostnamer   sessionzOptional[_SSL.Session]r   r.   r   )r   s   "r   r   r   w  sP     1 11 1 "&	1
 #1 '1 (1 
1r    c                   \        V P                  W4      pV'       d   VP                  V4       VRJ d   VP                  4        MxV'       d2   \	        V4      '       g!   VP                  VP                  R4      4       V P                  \        P                  8w  d   VP                  4        VP                  4        V'       df   VP                  4        V P                  '       dD   Ve@   ^ RIHp  \	        V4      '       d   VP!                  Wu4       V# VP#                  Wu4        V# V#   \        P$                  \        P&                  3 d   p	\)        \+        T	4      4      RhRp	?	ii ; i)zJWrap an existing Python socket connection and return a TLS socket
object.
TidnaN)	pyopenssl)r.   r   set_sessionset_accept_stater%   set_tlsext_host_namer   verify_moder   	CERT_NONErequest_ocspset_connect_staterV   r   service_identityr  verify_ip_addressverify_hostnameCertificateErrorVerificationErrorr   r   )
r:   r1   r  r  r2   r  r  ssl_connr  r'   s
   &&&&&&&   r   wrap_socketSSLContext.wrap_socketw  s4    DIItB  )$%%' ~o'F'F --o.D.DV.LM:#7#77%%'&&( # !!# """'B6	@%o66!33HN  "11(L x	 %55$66 @ ,CH54?	@s   4"D. D. .%E-E((E-)r   r   r   r   )r   r   r   r   )NN)FTTNN)rv   rw   rx   ry   r   	__slots__r9   propertyr   _SSLContext__get_verify_mode_SSLContext__set_verify_moder#  _SSLContext__get_check_hostname_SSLContext__set_check_hostnamer   $_SSLContext__get_check_ocsp_endpoint$_SSLContext__set_check_ocsp_endpointr   _SSLContext__get_options_SSLContext__set_optionsoptionsr   r   r   r  r  r  r-  rz   r   r    r   r   r      s     KI
^  @6* ,.?@K$% 24HIN78 ##<>WX(* }m4G%<8
- -1 1r    r   )Tr   
__future__r   socketrF   sslr   sysr  timerB   errnor   rn   	ipaddressr   r"   typingr   r   r   r   r	   r
   cryptography.x509r   r'  OpenSSLr   rJ   r   r   pymongo.errorsr   r   r   pymongo.ocsp_cacher   pymongo.ocsp_supportr   pymongo.socket_checkerr   r6   r   pymongo.write_concernr   r   r   r   r   ImportErrorSSLv23_METHODPROTOCOL_SSLv23OP_NO_SSLv2OP_NO_SSLv3OP_NO_COMPRESSIONgetattrr   HAS_SNIIS_PYOPENSSLErrorrH   r$  VERIFY_NONECERT_OPTIONALVERIFY_PEERCERT_REQUIREDVERIFY_FAIL_IF_NO_PEER_CERTr   itemsr   r%   rK   rL   WantX509LookupErrorrD   BLOCKING_IO_READ_ERRORBLOCKING_IO_WRITE_ERRORBLOCKING_IO_LOOKUP_ERRORr,   
Connectionr.   r}   r   )keyr   s   00r   <module>r_     s  
 #     ! / I I     % D , ) / B 8 2 T]M $$** d$91=   :: $**d..d..1Q1QQ 5@4E4E4GH4Gjcuz4GH 
 (($*=*=t?W?WX ++ -- 33 .Pt Pf0 0a ae  M2 Is   G G#	G G 