e}|~SSKrSSKrSSKrSSKrSSKJr SSKJr SSKJr SSKJ r SSK J r \b\R\R4r"SS \R5r"S S \R5rS rS r"SS\ R(\ R*5r"SS\R.5rg!\a SrNf=f)N) constants) exceptions) protocols) transports)loggerc(\rSrSrSrSrSrSrSrSr g) SSLProtocolState UNWRAPPED DO_HANDSHAKEWRAPPEDFLUSHINGSHUTDOWNN) __name__ __module__ __qualname____firstlineno__r r rrr__static_attributes__r6/opt/imh/python3.13/lib/python3.13/asyncio/sslproto.pyr r sI!LGHHrr c$\rSrSrSrSrSrSrSrg)AppProtocolState STATE_INITSTATE_CON_MADE STATE_EOFSTATE_CON_LOSTrN) rrrrrrrrrrrrrrsJ%NI%NrrcpU(a [S5e[R"5nU(dSUlU$)Nz(Server side SSL needs a valid SSLContextF) ValueErrorsslcreate_default_contextcheck_hostname) server_sideserver_hostname sslcontexts r_create_transport_contextr(/s2CDD ++-J $) ! rcUcUcUS-nO UnSU-nOUnUcUS-nOUnX4s=:aS:dO [SU<SU<S35eX44$)Nirzhigh (z) must be >= low (z) must be >= 0)r!)highlowkbhilos radd_flowcontrol_defaultsr0=sd | ;dBBRB  { 1W  =q=b"# # 6Mrc\rSrSrSr\R RrSr SSjr Sr Sr Sr S r\4S jrS rS rS rSSjrSrSrSSjrSrSr\S5rSrSrSrSrSr Sr!Sr"Sr#g)_SSLProtocolTransportRTc*XlX lSUlg)NF)_loop _ssl_protocol_closed)selfloop ssl_protocols r__init___SSLProtocolTransport.__init__Xs ) rNc8URRX5$)z#Get optional transport information.)r6_get_extra_infor8namedefaults rget_extra_info$_SSLProtocolTransport.get_extra_info]s!!11$@@rc:URRU5 gN)r6_set_app_protocol)r8protocols r set_protocol"_SSLProtocolTransport.set_protocolas ,,X6rc.URR$rE)r6 _app_protocolr8s r get_protocol"_SSLProtocolTransport.get_protocolds!!///rc\UR=(d URR5$rE)r7r6_is_transport_closingrLs r is_closing _SSLProtocolTransport.is_closinggs ||It11GGIIrcxUR(d"SUlURR5 gSUlg)zClose the transport. Buffered data will be flushed asynchronously. No more data will be received. After all buffered data is flushed, the protocol's connection_lost() method will (eventually) called with None as its argument. TN)r7r6_start_shutdownrLs rclose_SSLProtocolTransport.closejs,||DL    . . 0!%D rcbUR(dSUlURS[5 gg)NTz9unclosed transport )r7warnResourceWarning)r8 _warningss r__del___SSLProtocolTransport.__del__xs)||DL NN* ,rc8URR(+$rE)r6_app_reading_pausedrLs r is_reading _SSLProtocolTransport.is_readings%%9999rc8URR5 g)z|Pause the receiving end. No data will be passed to the protocol's data_received() method until resume_reading() is called. N)r6_pause_readingrLs r pause_reading#_SSLProtocolTransport.pause_readings ))+rc8URR5 g)zmResume the receiving end. Data received will once again be passed to the protocol's data_received() method. N)r6_resume_readingrLs rresume_reading$_SSLProtocolTransport.resume_readings **,rcnURRX5 URR5 g)a.Set the high- and low-water limits for write flow control. These two values control when to call the protocol's pause_writing() and resume_writing() methods. If specified, the low-water limit must be less than or equal to the high-water limit. Neither value can be negative. The defaults are implementation-specific. If only the high-water limit is given, the low-water limit defaults to an implementation-specific value less than or equal to the high-water limit. Setting high to zero forces low to zero as well, and causes pause_writing() to be called whenever the buffer becomes non-empty. Setting low to zero causes resume_writing() to be called only once the buffer is empty. Use of zero for either limit is generally sub-optimal as it reduces opportunities for doing I/O and computation concurrently. N)r6_set_write_buffer_limits_control_app_writingr8r+r,s rset_write_buffer_limits-_SSLProtocolTransport.set_write_buffer_limitss*& 33D> //1rcZURRURR4$rE)r6_outgoing_low_water_outgoing_high_waterrLs rget_write_buffer_limits-_SSLProtocolTransport.get_write_buffer_limits*""66""779 9rc6URR5$)z-Return the current size of the write buffers.)r6_get_write_buffer_sizerLs rget_write_buffer_size+_SSLProtocolTransport.get_write_buffer_sizes!!88::rcnURRX5 URR5 g)a7Set the high- and low-water limits for read flow control. These two values control when to call the upstream transport's pause_reading() and resume_reading() methods. If specified, the low-water limit must be less than or equal to the high-water limit. Neither value can be negative. The defaults are implementation-specific. If only the high-water limit is given, the low-water limit defaults to an implementation-specific value less than or equal to the high-water limit. Setting high to zero forces low to zero as well, and causes pause_reading() to be called whenever the buffer becomes non-empty. Setting low to zero causes resume_reading() to be called only once the buffer is empty. Use of zero for either limit is generally sub-optimal as it reduces opportunities for doing I/O and computation concurrently. N)r6_set_read_buffer_limits_control_ssl_readingrls rset_read_buffer_limits,_SSLProtocolTransport.set_read_buffer_limitss*& 224= //1rcZURRURR4$rE)r6_incoming_low_water_incoming_high_waterrLs rget_read_buffer_limits,_SSLProtocolTransport.get_read_buffer_limitsrtrc6URR5$)z+Return the current size of the read buffer.)r6_get_read_buffer_sizerLs rget_read_buffer_size*_SSLProtocolTransport.get_read_buffer_sizes!!7799rc.URR$rE)r6_app_writing_pausedrLs r_protocol_paused&_SSLProtocolTransport._protocol_pauseds!!555rc[U[[[45(d![ S[ U5R 35eU(dgURRU45 g)zWrite some data bytes to the transport. This does not block; it buffers the data and arranges for it to be sent out asynchronously. z+data: expecting a bytes-like instance, got N) isinstancebytes bytearray memoryview TypeErrortyperr6_write_appdatar8datas rwrite_SSLProtocolTransport.writes[ $ : >??##':#6#6"79: :  ))4'2rc:URRU5 g)zWrite a list (or any iterable) of data bytes to the transport. The default implementation concatenates the arguments and calls write() on the result. N)r6r)r8 list_of_datas r writelines _SSLProtocolTransport.writeliness )),7rc[e)zeClose the write end after flushing buffered data. This raises :exc:`NotImplementedError` right now. )NotImplementedErrorrLs r write_eof_SSLProtocolTransport.write_eofs "!rcg)zAReturn True if this transport supports write_eof(), False if not.FrrLs r can_write_eof#_SSLProtocolTransport.can_write_eofsrc&URS5 g)zClose the transport immediately. Buffered data will be lost. No more data will be received. The protocol's connection_lost() method will (eventually) be called with None as its argument. N) _force_closerLs rabort_SSLProtocolTransport.aborts $rcdSUlURbURRU5 ggNT)r7r6_abortr8excs rr"_SSLProtocolTransport._force_closes.    )    % %c * *rcURRRU5 UR=R[ U5- slgrE)r6_write_backlogappend_write_buffer_sizelenrs r_test__append_write_backlog1_SSLProtocolTransport._test__append_write_backlogs7 ))006 --T:-r)r7r5r6rENN)$rrrr_start_tls_compatibler _SendfileModeFALLBACK_sendfile_compatibler;rBrHrMrQrUwarningsr[r_rcrgrmrrrwr|rrpropertyrrrrrrrrrrrrr2r2Rs!$22;; A70J &!),:,-2,9;2,9:66 38" + ;rr2c4\rSrSrSrSrSrSrS-SjrSr S.Sjr Sr Sr S r S rS rS rS rS.SjrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"Sr#S r$S!r%S"r&S/S#jr'S$r(S%r)S&r*S/S'jr+S(r,S)r-S*r.S0S+jr/S,r0g)1 SSLProtocoliiNc [c [S5e[UR5Ul[ UR5UlUc[RnOUS::a[SU35eU c[Rn OU S::a[SU 35eU(d [XV5nXPl U(aU(dX`l OSUl X0l[US9Ul["R$"5UlSUlX@lXlUR/U5 SUlSUlSUlXlXl[R:"5Ul[R:"5Ul[@RBUl"SUl#U(a[HRJUl&O[HRNUl&URRQUR<UR>URURS9Ul)SUl*SUl+SUl,SUl-SUl.UR_5 SUl0SUl1SUl2SUl3URi5 URk5 g)Nzstdlib ssl module not availablerz7ssl_handshake_timeout should be a positive number, got z6ssl_shutdown_timeout should be a positive number, got )r'F)r%r&)6r" RuntimeErrorrmax_size _ssl_bufferr_ssl_buffer_viewrSSL_HANDSHAKE_TIMEOUTr!SSL_SHUTDOWN_TIMEOUTr( _server_side_server_hostname _sslcontextdict_extra collectionsdequerr_waiterr5rF_app_transport_app_transport_created _transport_ssl_handshake_timeout_ssl_shutdown_timeout MemoryBIO _incoming _outgoingr r _state _conn_lostrr _app_staterwrap_bio_sslobj_ssl_writing_pausedr^_ssl_reading_pausedrrrz _eof_receivedrrqrprj_get_app_transport) r8r9 app_protocolr'waiterr%r&call_connection_madessl_handshake_timeoutssl_shutdown_timeouts rr;SSLProtocol.__init__s5 ;@A A$T]]3 *4+;+; < ($-$C$C ! "a ',-/0 0 '#,#A#A !Q &+,./ /2.J( ;$3 !$(D !%j1 *//1"#   |,"&+#&;#%9"&00  .99DO.==DO''00 NNDNN)) 1113 $) #( #( $%!#$  $$&"#( $%!#$  %%' !rcXl[US5(aI[U[R5(a*UR UlURUlSUl gSUl g)N get_bufferTF) rKhasattrrrBufferedProtocolr_app_protocol_get_bufferbuffer_updated_app_protocol_buffer_updated_app_protocol_is_buffer)r8rs rrFSSLProtocol._set_app_protocolasT) L, / /<)C)CDD,8,C,CD )0<0K0KD -+/D (+0D (rcURcgURR5(d:UbURRU5 OURRS5 SUlgrE)r cancelled set_exception set_resultrs r_wakeup_waiterSSLProtocol._wakeup_waiterlsR <<  ||%%'' **3/ ''- rcURc>UR(a [S5e[URU5UlSUlUR$)Nz$Creating _SSLProtocolTransport twiceT)rrrr2r5rLs rrSSLProtocol._get_app_transportvsJ    &**"#IJJ"7 D"ID *.D '"""rc`URSL=(a URR5$rE)rrQrLs rrP!SSLProtocol._is_transport_closing~s#d*Kt/I/I/KKrc0XlUR5 g)zHCalled when the low-level connection is made. Start the SSL handshake. N)r_start_handshake)r8 transports rconnection_madeSSLProtocol.connection_mades $ rcdURR5 URR5 U=RS- slUR bSUR lUR[R:waUR[R:XdUR[R:XaE[RUl URR!UR"R$U5 UR'[R(5 SUlSUlSUlUR-U5 UR.(a!UR.R15 SUlUR2(a"UR2R15 SUlgg)zCalled when the low-level connection is lost or closed. The argument is an exception object or None (the latter meaning a regular EOF is received or the connection was aborted or closed). rNT)rclearrreadrrr7rr r rrrrrr5 call_soonrKconnection_lost _set_stater rr_shutdown_timeout_handlecancel_handshake_timeout_handlers rrSSLProtocol.connection_losts9 !!#  1    **.D   ' ;;*77 7#3#B#BB#3#=#=="2"A"A $$T%7%7%G%GM (223"! C  ( (  ) ) 0 0 2,0D )  ) )  * * 1 1 3-1D * *rcUnUS::dX R:a URn[UR5U:a*[U5Ul[ UR5UlUR $Nr)rrrrrr)r8nwants rrSSLProtocol.get_buffers^ 19}},==D t 4 '(D $.t/?/?$@D !$$$rcURRURSU5 UR[R :XaUR 5 gUR[R:XaUR5 gUR[R:XaUR5 gUR[R:XaUR5 ggrE) rrrrr r _do_handshaker_do_readr _do_flushr _do_shutdown)r8nbytess rrSSLProtocol.buffer_updateds T227F;< ;;*77 7    [[,44 4 MMO [[,55 5 NN  [[,55 5    6rcSUlURR5(a[R"SU5 UR [ R:XaUR[5 gUR [ R:XaBUR[ R5 UR(agUR5 gUR [ R:Xa@UR5 UR[ R 5 UR#5 gUR [ R :XaUR#5 gg![$a UR&R)5 ef=f)zCalled when the other end of the low-level stream is half-closed. If this returns a false value (including None), the transport will close itself. If it returns a true value, closing the transport is up to the protocol. Tz%r received EOFN)rr5 get_debugrdebugrr r _on_handshake_completeConnectionResetErrorrrrr^r  _do_writerr  ExceptionrrUrLs r eof_receivedSSLProtocol.eof_receiveds" zz##%% .5{{.;;;++,@A 0 8 88 0 9 9:++NN$ 0 9 99  0 9 9:!!# 0 9 99!!#:  OO ! ! #  s&A)E!3AE!E!AE!1.E!!&FcXR;aURU$URbURRX5$U$rE)rrrBr?s rr>SSLProtocol._get_extra_infos? ;; ;;t$ $ __ (??11$@ @Nrc@SnU[R:XaSnOUR[R:XaU[R:XaSnOUR[R:XaU[R:XaSnOiUR[R:XaU[R :XaSnO4UR[R :XaU[R :XaSnU(aXlg[SRURU55e)NFTz!cannot switch state from {} to {}) r r rr rrrrformat)r8 new_statealloweds rrSSLProtocol._set_states (22 2G KK+55 5 )66 6G KK+88 8 )11 1G KK+33 3 )22 2G KK+44 4 )22 2G #K3::KK,- -rcURR5(a7[R"SU5 URR 5UlOSUlUR [R5 URRURUR5Ul UR5 g)Nz%r starts SSL handshake)r5rrrtime_handshake_start_timerr r call_laterr_check_handshake_timeoutrr rLs rrSSLProtocol._start_handshakes ::   ! ! LL2D 9)-):D &)-D & (556 JJ ! !$"="="&"?"? A & rcUR[R:Xa+SURS3nUR [ U55 gg)Nz$SSL handshake is taking longer than z! seconds: aborting the connection)rr r r _fatal_errorConnectionAbortedError)r8msgs rr$$SSLProtocol._check_handshake_timeout(sN ;;*77 76../0*+    4S9 : 8rcURR5 URS5 g![a UR 5 g[ R anURU5 SnAgSnAff=frE)r do_handshakerSSLAgainErrors_process_outgoingr"SSLErrorrs rr SSLProtocol._do_handshake1sb . LL % % '  ' ' -  %  " " $|| -  ' ' , , -s.A8 A8A33A8cURb!URR5 SUlURnUc UR[R 5 OUeUR 5nURR5(aAURR!5UR"- n[$R&"SXS-5 UR(R+UUR-5UR/5US9 UR0[2R4:Xa>[2R6UlUR8R;UR=55 UR5 UR?5 g![aqnSnUR[R5 [U[R5(aSnOSnURXE5 URU5 SnAgSnAff=f)Nz1SSL handshake failed on verifying the certificatezSSL handshake failedz%r: SSL handshake took %.1f msg@@)peercertcipher compression ssl_object) rrrrr r getpeercertrr rr"CertificateErrorr'rr5rr!r"rrrupdater3r4rrrrrKrrr )r8 handshake_excsslobjr2rr)dts rr"SSLProtocol._on_handshake_complete;s  ) ) 5  * * 1 1 3-1D * $ 0 8 89##))+H ::   ! !"T%?%??B LL94c J H"(--/'-'9'9';&,  . ??.99 9.==DO    . .t/F/F/H I  1  M OO,66 7#s3344I,   c '    $  s5F HA'G<<HcUR[R[R[R4;agUR bSUR lUR[R:XaURS5 gUR[R5 URRURUR5UlUR5 gr)rr rrr rr7r rrr5r#r_check_shutdown_timeoutrr rLs rrTSSLProtocol._start_shutdownds KK )) )) **      **.D   ' ;;*77 7 KK  OO,55 6,0JJ,A,A**,,-D ) NN rcUR[R[R4;a0URR [ R"S55 gg)NzSSL shutdown timed out)rr rrrrr TimeoutErrorrLs rr>#SSLProtocol._check_shutdown_timeoutysN KK )) ))  OO ( (''(@A C  rcUR5 UR[R5 UR 5 grE)r rr rr rLs rr SSLProtocol._do_flushs*  (112 rcXUR(dURR5 UR5 UR 5 UR S5 g![ a UR5 g[RanUR U5 SnAgSnAff=frE) rrunwrapr._call_eof_received_on_shutdown_completer-r"r/rs rr SSLProtocol._do_shutdowns -%% ##%  " " $  # # %  & &t , %  " " $|| ,  & &s + + ,s+AB);B)B$$B)cURb!URR5 SUlU(aURU5 gURR UR R 5 grE)rrr'r5rrrU)r8 shutdown_excs rrH!SSLProtocol._on_shutdown_completesU  ( ( 4  ) ) 0 0 2,0D )    l + JJ !6!6 7rcUR[R5 URbURR U5 ggrE)rr r rrrs rrSSLProtocol._aborts6 (223 ?? & OO ( ( - 'rcHUR[R[R[R4;aJUR [ R:a[R"S5 U=R S- slgUH<nURRU5 U=R[U5- sl M> UR[R:XaUR5 gg![ anUR#US5 SnAgSnAff=f)NzSSL connection is closedrFatal error on SSL protocol)rr rrr rr!LOG_THRESHOLD_FOR_CONNLOST_WRITESrwarningrrrrrrrr')r8rrexs rrSSLProtocol._write_appdatas KK )) )) **  )"M"MM9: OOq O  D    & &t ,  # #s4y 0 #! A{{.666 7 A   b"? @ @ As .C;; D!DD!cUR(aURSnURRU5n[U5nX#:a'XSURS'U=RU-slO"URS U=RU-slUR(aMUR 5 g![ a Nf=fr)rrrrrr-r.)r8rcountdata_lens rrSSLProtocol._do_writes %%**1- **40t9#-1&\D''*++u4+++A.++x7+%%%     sB%B:: CCcUR(dEURR5n[U5(aURR U5 UR 5 grE)rrrrrrrkrs rr.SSLProtocol._process_outgoingsD''>>&&(D4yy%%d+ !!#rcUR[R[R4;agUR(ddUR (aUR 5 OUR5 UR(aUR5 OUR5 UR5 g![anURUS5 SnAgSnAff=f)NrP)rr rrr^r_do_read__buffered_do_read__copiedrrr.r{rr')r8rSs rr SSLProtocol._do_reads KK (( ))    A++//++-))+&&NN$**,  % % ' A   b"? @ @ AsBB77 CCCcSnSnURUR55n[U5nURR XC5nUS:a_UnX:a3URR XA- X1S5nUS:aX- nOO,X:aM3UR R UR5 US:aURU5 U(d!UR5 UR5 gg![a NLf=f)Nrr) rrrrrr5rr r-rrGrT)r8offsetrVbufwantss rr\SSLProtocol._do_read__buffereds++D,F,F,HIC LL%%e1Eqyn LL--enc'lKEqy nJJ((7 A:  - -f 5  # # %  "    sAC0C0 %C00 C=<C=cSnSnSnURRUR5nU(dO/U(aSnSnUnOU(aSnWU/nOWRU5 M\U(aUR R W5 O1U(d*UR R SRW55 U(d!UR5 UR5 gg![a Nf=f)N1TFr) rrrrr-rK data_receivedjoinrGrT)r8chunkzeroonefirstrs rr]SSLProtocol._do_read__copied s  ))$--8 DC!EC!5>DKK&     , ,U 3    , ,SXXd^ <  # # %  "    s-C"/C"" C/.C/cPUR[R:XaN[RUlURR 5nU(a[ R"S5 ggg![[4a e[anURUS5 SnAgSnAff=f)Nz?returning true from eof_received() has no effect when using sslzError calling eof_received()) rrrrrKrrrRKeyboardInterrupt SystemExit BaseExceptionr')r8 keep_openrSs rrGSSLProtocol._call_eof_received(s B"2"A"AA"2"<"< ..;;= NN$BCB ":.   B   b"@ A A BsA*A//B% B  B%cvUR5nXR:a4UR(d#SUlURR 5 gXR::a5UR(a#SUlURR5 ggg![ [ 4a e[a4nURRSUURUS.5 SnAgSnAff=f![ [ 4a e[a4nURRSUURUS.5 SnAgSnAff=f)NTzprotocol.pause_writing() failedmessage exceptionrrGFz protocol.resume_writing() failed) rvrqrrK pause_writingrnrorpr5call_exception_handlerrrpresume_writing)r8sizers rrk SSLProtocol._control_app_writing7s **, ,, ,T5M5M'+D $ ""002-- -$2J2J',D $ ""1133K -&z2    11@!$!%!4!4 $ 3 &z2    11A!$!%!4!4 $ 3 s/B<C*C'3*C""C'*D8*D33D8cHURRUR-$rE)rpendingrrLs rrv"SSLProtocol._get_write_buffer_sizeTs~~%%(?(???rcT[X[R5upXlX lgrE)r0r!FLOW_CONTROL_HIGH_WATER_SSL_WRITErqrprls rrj$SSLProtocol._set_write_buffer_limitsWs&, yBBD $(!#& rcSUlgr)r^rLs rrbSSLProtocol._pause_reading_s #' rcz^TR(a)STlU4SjnTRRU5 gg)NFc >TR[R:XaTR5 gTR[R:XaTR 5 gTR[R :XaTR5 ggrE)rr rr rr rr rLsrresume+SSLProtocol._resume_reading..resumefs`;;"2":"::MMO[[$4$=$==NN$[[$4$=$==%%'>r)r^r5r)r8rs` rrfSSLProtocol._resume_readingbs2  # #',D $ ( JJ  ( $rc.UR5nXR:a3UR(d"SUlURR 5 gXR ::a4UR(a"SUlURR 5 ggg)NTF)rrrrrcrrg)r8rzs rr{ SSLProtocol._control_ssl_readingqsq))+ ,, ,T5M5M'+D $ OO ) ) + -- -$2J2J',D $ OO * * ,3K -rcT[X[R5upXlX lgrE)r0r FLOW_CONTROL_HIGH_WATER_SSL_READrrrls rrz#SSLProtocol._set_read_buffer_limitszs&, yAAC $(!#& rc.URR$rE)rr}rLs rr!SSLProtocol._get_read_buffer_sizes~~%%%rc8UR(aeSUlg)zLCalled when the low-level transport's buffer goes over the high-water mark. TN)rrLs rrwSSLProtocol.pause_writings++++#' rcXUR(deSUlUR5 g)zNCalled when the low-level transport's buffer drains below the low-water mark. FN)rr.rLs rrySSLProtocol.resume_writings'''''#(   rcUR(aURRU5 [U[5(a7URR 5(a[ R"SXSS9 gg[U[R5(d+URRUUURUS.5 gg)Nz%r: %sT)exc_infort) rrrOSErrorr5rrrrCancelledErrorrx)r8rrus rr'SSLProtocol._fatal_errors ?? OO ( ( - c7 # #zz##%% XttD&C!:!:;; JJ - -" !__ / rrr$r rrTr>r r rHrrrr.r r\r]rGrkrvrjrbrfr{rzrrwryr'rrrrrrsH  $#59&*'+&* Q"f 1#L "2H%  !F$-P ;.%R*C -8.A0! $A,#:#< B:@'( )-' & (! rr)renumrr" ImportErrorrrrrlogrSSLWantReadErrorSSLSyscallErrorr-Enumr rr(r0_FlowControlMixin Transportr2rrrrrrs  ?**C,?,?@Ntyy &tyy & *r;J88&00r;jZ ),,Z { CsB11B<;B<