Qf n ddlZddlZddlmZddlmZmZm Z ddlm Z ddl Z ddl m Z mZmZddl mZmZmZddl mZmZmZmZmZmZmZddl mZmZdd l mZmZm Z  dd l m!Z!dd l m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd l m-Z-m.Z.ej^d e0de e j^de0de ej^de0de ej^de0de e j^de0de ej^de0de e1jdxZ3e1_3e1jhjkDcic]\}}|| c}}Z6e7e1ddZ8e eGddZ9e eGddZ:e eGdd Z;e eGd!d"ZZ>m?Z?dd%l@m@Z@mAZAmBZBdd&l@mCZCmDZDmEZEddl@ZFddlGZGddlHZHddlIZIeJZKd'gZLeMe d(ZNe-ZOeZPd)ZQd*ZRd+ZSed,d-ZTd.ZUGd/d0ed0d1ZVGd2d3eVeZWGd4d5eZXeWjfdddd6d7ZZdGe[d8eWjdddddd9d:Z\eZZ]e\Z^Gd;d<Z_d=Z`Gd>d?e@ZaeaeX_be_eX_cd@ZddAZedBZfdCZgdDZheideEfdEZjdFZky#e"$rYJwxYwcc}}w)HN) namedtuple)EnumIntEnumIntFlag) _simple_enum)OPENSSL_VERSION_NUMBEROPENSSL_VERSION_INFOOPENSSL_VERSION) _SSLContext MemoryBIO SSLSession)SSLErrorSSLZeroReturnErrorSSLWantReadErrorSSLWantWriteErrorSSLSyscallError SSLEOFErrorSSLCertVerificationError)txt2objnid2obj) RAND_statusRAND_add RAND_bytes)RAND_egd) HAS_SNIHAS_ECDHHAS_NPNHAS_ALPN HAS_SSLv2 HAS_SSLv3 HAS_TLSv1 HAS_TLSv1_1 HAS_TLSv1_2 HAS_TLSv1_3)_DEFAULT_CIPHERS_OPENSSL_API_VERSION _SSLMethodc2|jdxr|dk7S)N PROTOCOL_PROTOCOL_SSLv23 startswithnames */opt/alt/python312/lib64/python3.12/ssl.pyr0}s-K$:K2KK)sourceOptionsc$|jdS)NOP_r+r-s r/r0r0s 'r1AlertDescriptionc$|jdS)NALERT_DESCRIPTION_r+r-s r/r0r0s!56r1SSLErrorNumberc$|jdS)N SSL_ERROR_r+r-s r/r0r0s .r1 VerifyFlagsc$|jdS)NVERIFY_r+r-s r/r0r0s +r1 VerifyModec$|jdS)NCERT_r+r-s r/r0r0s )r1PROTOCOL_SSLv2ceZdZejZej ZejZ ejZ ejZ ejZej Zy) TLSVersionN)__name__ __module__ __qualname___sslPROTO_MINIMUM_SUPPORTEDMINIMUM_SUPPORTED PROTO_SSLv3SSLv3 PROTO_TLSv1TLSv1 PROTO_TLSv1_1TLSv1_1 PROTO_TLSv1_2TLSv1_2 PROTO_TLSv1_3TLSv1_3PROTO_MAXIMUM_SUPPORTEDMAXIMUM_SUPPORTEDr1r/rDrDsQ44   E   E  G  G  G44r1rDc&eZdZ dZdZdZdZdZdZy)_TLSContentTypeN) rErFrGCHANGE_CIPHER_SPECALERT HANDSHAKEAPPLICATION_DATAHEADERINNER_CONTENT_TYPErWr1r/rYrYs* EI Fr1rYceZdZ dZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$y#)$ _TLSAlertTyper rZr[r\()*+,-./0123<FGPVZdmnopqrstxN)%rErFrG CLOSE_NOTIFYUNEXPECTED_MESSAGEBAD_RECORD_MACDECRYPTION_FAILEDRECORD_OVERFLOWDECOMPRESSION_FAILUREHANDSHAKE_FAILURENO_CERTIFICATEBAD_CERTIFICATEUNSUPPORTED_CERTIFICATECERTIFICATE_REVOKEDCERTIFICATE_EXPIREDCERTIFICATE_UNKNOWNILLEGAL_PARAMETER UNKNOWN_CA ACCESS_DENIED DECODE_ERROR DECRYPT_ERROREXPORT_RESTRICTIONPROTOCOL_VERSIONINSUFFICIENT_SECURITYINTERNAL_ERRORINAPPROPRIATE_FALLBACK USER_CANCELEDNO_RENEGOTIATIONMISSING_EXTENSIONUNSUPPORTED_EXTENSIONCERTIFICATE_UNOBTAINABLEUNRECOGNIZED_NAMEBAD_CERTIFICATE_STATUS_RESPONSEBAD_CERTIFICATE_HASH_VALUEUNKNOWN_PSK_IDENTITYCERTIFICATE_REQUIREDNO_APPLICATION_PROTOCOLrWr1r/rgrgsLNONO JMLMNM"&)#!$!r1rgcfeZdZ dZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZy)_TLSMessageTyper rZr[r\r]Cr_N)rErFrG HELLO_REQUEST CLIENT_HELLO SERVER_HELLOHELLO_VERIFY_REQUESTNEWSESSION_TICKETEND_OF_EARLY_DATAHELLO_RETRY_REQUESTENCRYPTED_EXTENSIONS CERTIFICATESERVER_KEY_EXCHANGECERTIFICATE_REQUEST SERVER_DONECERTIFICATE_VERIFYCLIENT_KEY_EXCHANGEFINISHEDCERTIFICATE_URLCERTIFICATE_STATUSSUPPLEMENTAL_DATA KEY_UPDATE NEXT_PROTO MESSAGE_HASHr`rWr1r/rrsMLLKKHOJJLr1rwin32)enum_certificates enum_crls)socket SOCK_STREAMcreate_connection) SOL_SOCKETSO_TYPE_GLOBAL_DEFAULT_TIMEOUT tls-uniqueHOSTFLAG_NEVER_CHECK_SUBJECTc |sy|jd}|s!|j|jk(S|dkDrtdj||j d\}}}d|vrtdj||stdj||dk7rtdj||j d\}}}|r|sy|j|jk(S) NF*rz1too many wildcards in certificate DNS name: {!r}..z9wildcard can only be present in the leftmost label: {!r}.z>sole wildcard without additional labels are not support: {!r}.zfD(* f(=f4 &$ &&r1cLeZdZ dZfdZefdZefdZxZS) _ASN1ObjectrWc:t||gt|dS)NFr-super__new___txt2obj)clsoid __class__s r/rz_ASN1Object.__new__sws?Xc%>??r1c8 t||gt|Sr)rr_nid2obj)rnidrs r/fromnidz_ASN1Object.fromnids  ws3Xc]33r1c< t||gt|dS)NTr-r )rr.rs r/fromnamez_ASN1Object.fromnames# ws?Xd%>??r1) rErFrG __slots__r classmethodrr __classcell__rs@r/r r s=I@44 @@r1r znid shortname longname oidceZdZ dZdZy)Purposez1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)rErFrG SERVER_AUTH CLIENT_AUTHrWr1r/rrs%K%Kr1rcheZdZ dZdZdZddZdZ ddZ d dZ dZ dZ d Z d Z ejfd Zeed r   # &??6*11': :??7+ +r1c F|jj|||||||S)N)sock server_sidedo_handshake_on_connectsuppress_ragged_eofsserver_hostnamecontextsession)sslsocket_class_create)r0r:r;r<r=r>r@s r/ wrap_socketzSSLContext.wrap_sockets7 ##++#$;!5+,  r1cb|jj||||j|||S)N)r;r>r@r?)sslobject_classrBr8)r0incomingoutgoingr;r>r@s r/wrap_biozSSLContext.wrap_bios<##++ hK 11/BT,  r1c<tjdtdt}|D]`}t |d}t |dk(st |dkDr t d|jt ||j|b|j|y)N'ssl NPN is deprecated, use ALPN insteadrr(r3rz(NPN protocols must be 1 to 255 in length) r)r*r+ bytearraybyteslenrappendextend_set_npn_protocols)r0 npn_protocolsprotosr-bs r/set_npn_protocolszSSLContext.set_npn_protocolss 5  %Hh(A1v{c!fslIJJ MM#a& ! MM!  & 'r1cbd_yts tdfd}|_y)Nznot a callable objectc:j|}|||Sr)r8)sslobj servernamesslctxr0server_name_callbacks r/shim_cbz3SSLContext.set_servername_callback..shim_cbs"!22:> +FJGGr1) sni_callbackcallable TypeError)r0r\r]s`` r/set_servername_callbackz"SSLContext.set_servername_callbacks6  ' $D 01 788 H!(D r1ct}|D]`}t|d}t|dk(st|dkDr td|j t||j |b|j |y)Nr3rrLz)ALPN protocols must be 1 to 255 in length)rMrNrOrrPrQ_set_alpn_protocols)r0alpn_protocolsrTr-rUs r/set_alpn_protocolszSSLContext.set_alpn_protocolssl&Hh(A1v{c!fslJKK MM#a& ! MM!  '   (r1c* t|D]2\}}}|dk(s |dus|j|vs |j|4y#t$r"}t j d|Yd}~\d}~wwxYw#t $rt j dYywxYw)Nx509_asnT)cadataz.Bad certificate in Windows certificate store: z-unable to enumerate Windows certificate store)rrload_verify_locationsrr)r*PermissionError)r0 storenamepurposecertencodingtrustexcs r/_load_windows_store_certsz$SSLContext._load_windows_store_certss K):9)E%hz)} u(<d 66d6C *F (d$MM,Z[^Za*bccd K MMI J Ks?A1A1AA1 A. A)$A1)A..A11BBct|ts t|tjdk(r#|j D]}|j |||jy)Nr)r4r r`sysplatform_windows_cert_storesrqset_default_verify_paths)r0rlrks r/load_default_certszSSLContext.load_default_certssO';/G$ $ <<7 "!66 ..y'B7 %%'r1minimum_versionc*tt|Sr)rDrrxr0rs r/rxzSSLContext.minimum_versioneg56 6r1c|tjk(r$|xjtjzc_t t t j||yr) rDrLoptionsr3 OP_NO_SSLv3rr#rx__set__r0valuers r/rxzSSLContext.minimum_versions? ((( !4!4 44 *j 9 A A$ Nr1c*tt|Sr)rDrmaximum_versionrzs r/rzSSLContext.maximum_version#r{r1cJttt j||yr)rr#rrrs r/rzSSLContext.maximum_version's *j 9 A A$ Nr1c*tt|Sr)r3rr}rzs r/r}zSSLContext.options+suw''r1cJttt j||yr)rr#r}rrs r/r}zSSLContext.options/s j*-55dEBr1rcb|jtjz}|tjk7Sr _host_flagsrHr)r0ncss r/hostname_checks_common_namez&SSLContext.hostname_checks_common_name4s)""T%F%FFC$;;; ;r1c|r%|xjtjzc_y|xjtjzc_yrr)r0rs r/rz&SSLContext.hostname_checks_common_name9s6  T%F%F$FF   D$E$EE r1cyNTrWr0s r/rz&SSLContext.hostname_checks_common_name@sr1c8 t|}| |jSyr)r _msg_callback user_function)r0innerrs r/rzSSLContext._msg_callbackDs) >%  && &r1c#ttt j|dyt dst dfd}|_ttt j||y)N__call__z is not callable.c. t|} t|}|tjk(rt}n |tjk(rt }nt } ||}||||||S#t$rYgwxYw#t$rYjwxYw#t$rY6wxYwr)rDrrYrdrargr)conn directionversion content_typemsg_typedatamsg_enumcallbacks r/rz'SSLContext._msg_callback..innerts $W- .|< 555*!6!66(* #H-D)W((D: :'       s4 A* A9B* A65A69 BB BB)rr#rrhasattrr`r)r0rrrs ` r/rzSSLContext._msg_callbackksf   *j 7 ? ?d K x,xj(9:; ; :2' j*3;;D%Hr1c*tt|Sr)r'rr-rzs r/r-zSSLContext.protocols%'*++r1c*tt|Sr)r<r verify_flagsrzs r/rzSSLContext.verify_flagss57/00r1cJttt j||yr)rr#rrrs r/rzSSLContext.verify_flagss j*2::4Gr1cRt|} t|S#t$r|cYSwxYwr)r verify_moder?rrs r/rzSSLContext.verify_modes1# e$ $ L s  &&cJttt j||yr)rr#rrrs r/rzSSLContext.verify_modes j*199$Fr1r)FTTNN)FNN)rErFrGrurArErr8rCrHrVrarerqrr rwrr propertyrxsetterrr}rHrrr-rrrrs@r/r#r#s>)OO ,-2,0)-26 8=/3 ( ( ) K*1)<)<({-.  7  7    O  O  7  7    O  O(( ^^CCt34  <  < % + + F , F    $$L#I#IJ,,11HHGGr1r#)rr rhc t|ts t||tjk(r"t t }t|_d|_ n.|tjk(rt t}n t||s|s|r|j|||n$|jtk7r|j|t!|drBt"j$j'd}|r!t(j*j,s||_|S)NTkeylog_filename SSLKEYLOGFILE)r4r r`rr r#PROTOCOL_TLS_CLIENT CERT_REQUIREDrcheck_hostnamer!PROTOCOL_TLS_SERVERrri CERT_NONErwrrrrrsflagsignore_environmentr)rlrr rhr? keylogfiles r/create_default_contextrs g{ +  '%%%01+!% G'' '01!! 6%%fff=    ) ""7+w)*ZZ^^O4 cii::&0G # Nr1F) cert_reqsrrlcertfilekeyfilerr rhcn t|ts t||tjk(r |.t }n'|tj k(r |t}n t|t|} || _ ||| _ |rd| _ |r |s td|s|r| j|||s|s|r| j|||n$| jtk7r| j|t!| drBt"j$j'd} | r!t(j*j,s| | _| S)NTzcertfile must be specifiedrr)r4r r`rr rr!rrr#rrload_cert_chainrirrwrrrrrsrrr) r-rrrlrrrr rhr?rs r/_create_unverified_contextrs  g{ +  '%%%  *H G'' '  *H!!"G+G'!%x5667'26%%fff=    ) ""7+w)*ZZ^^O4 cii::&0G # Nr1ceZdZ dZe ddZedZejdZedZ e jdZ edZ ed Z ed Z dd Z d Zdd ZdZdZdZdZdZdZdZdZddZdZdZy) SSLObjectcFt|jjd)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().r`rrEr0r.r/s r/__init__zSSLObject.__init__s+~~&&'(L M  r1Ncd|j|}|j||||||}||_|S)N)r;r>ownerr@)r _wrap_bio_sslobj) rrFrGr;r>r@r?r0rYs r/rBzSSLObject._create#sD{{3"" hK+#    r1c0 |jjSrrr?rs r/r?zSSLObject.context/s6||###r1c&||j_yrrr0ctxs r/r?zSSLObject.context4s" r1c0 |jjSrrr@rs r/r@zSSLObject.session8s/||###r1c&||j_yrrr0r@s r/r@zSSLObject.session=s& r1c0 |jjSrrsession_reusedrs r/rzSSLObject.session_reusedAs<||***r1c0 |jjSr)rr;rs r/r;zSSLObject.server_sideFs3||'''r1c0 |jjSr)rr>rs r/r>zSSLObject.server_hostnameKs #||+++r1c~ ||jj||}|S|jj|}|Sr)rread)r0rObuffervs r/rzSSLObject.readQsG   !!#v.A !!#&Ar1c: |jj|Sr)rwriter0rs r/rzSSLObject.write]s ||!!$''r1c: |jj|Sr)r getpeercertr0 binary_forms r/rzSSLObject.getpeercertes ||'' 44r1c> tjdtdyNrJrrK)r)r*r+rs r/selected_npn_protocolzSSLObject.selected_npn_protocolns   5  r1c8 |jjSr)rselected_alpn_protocolrs r/rz SSLObject.selected_alpn_protocolxs ||2244r1c8 |jjSr)rcipherrs r/rzSSLObject.cipher~s (||""$$r1c8 |jjSr)rshared_ciphersrs r/rzSSLObject.shared_cipherss ||**,,r1c8 |jjSr)r compressionrs r/rzSSLObject.compressions P||''))r1c8 |jjSr)rpendingrs r/rzSSLObject.pendingsF||##%%r1c: |jjyr)r do_handshakers r/rzSSLObject.do_handshakes* !!#r1c8 |jjSr)rshutdownrs r/unwrapzSSLObject.unwraps/||$$&&r1c: |jj|Sr)rget_channel_bindingr0cb_types r/rzSSLObject.get_channel_bindings M||//88r1c8 |jjSrrrrs r/rzSSLObject.versions !||##%%r1c6|jjSr)rverify_client_post_handshakers r/rz&SSLObject.verify_client_post_handshakes||88::r1)FNNNNFr)rErFrGrrrBrr?rr@rr;r>rrrrrrrrrrrrrrrWr1r/rrs  5:=A  $$ ^^##$$ ^^''++((,, (5 5 % - * &$'9 & ;r1rcZ tt|jj|_|Sr)getattrrrE__doc__)funcs r/ _sslcopydocrs"49dmm4<r<r= getpeernamererrnoENOTCONN getblocking setblockingrecvEINVALrreasonlibrary settimeout _connected _wrap_socketrclose)rr:r;r<r=r>r?r@ sock_timeoutr/r0 connectedeblockingnotconn_pre_handshake_datar notconn_pre_handshake_data_errortimeoutrs r/rBzSSLSocket._creates ??:w /; >%&IJ J  "233" "/00  ! !/FG G( ;;TYYdjj;;= s{{3)&) i'1&1 C #DM#DM DLDL*D #*#;#;O#LD +BD ((D4;?C4<@>><@8.% @b       s%AJ9-G=BJ9 J6AJ1H#"J1# I%,/I J1 I%%|js|jyyr)rrrs r/_check_connectedzSSLSocket._check_connected>s     r1cF |j|j td ||jj||S|jj|S#t$r4}|j dt k(r|jr |Yd}~yYd}~yd}~wwxYw)Nz'Read on closed or unwrapped SSL socket.rr1)r0rrrrr. SSL_ERROR_EOFr=)r0rOrxs r/rzSSLSocket.readFs -  << FG G !||((f55||((-- vvayM)d.G.G% s#A#A## B ,$BBB c |j|j td|jj|S)Nz(Write on closed or unwrapped SSL socket.)r0rrrrs r/rzSSLSocket.write[s@ 9  << GH H||!!$''r1cx|j|j|jj|Sr)r0r2rrrs r/rzSSLSocket.getpeercertds/  ||'' 44r1c\|jtjdtdyr)r0r)r*r+rs r/rzSSLSocket.selected_npn_protocoljs(  5  r1c|j|jtjsy|jj Sr)r0rrHrrrs r/rz SSLSocket.selected_alpn_protocolts4  << t}}<<668 8r1cp|j|jy|jjSr)r0rrrs r/rzSSLSocket.cipher|s.  << <<&&( (r1cp|j|jy|jjSr)r0rrrs r/rzSSLSocket.shared_cipherss.  << <<..0 0r1cp|j|jy|jjSr)r0rrrs r/rzSSLSocket.compressions.  << <<++- -r1c|j|j8|dk7rtd|jz|jj |St |||S)Nrz3non-zero flags not allowed in calls to send() on %s)r0rrrrrsend)r0rrrs r/r>zSSLSocket.sendsd  << #z INN#$$<<%%d+ +7<e, ,r1c|j|jtd|jz|t|||St||||S)Nz%sendto not allowed on instances of %s)r0rrrrsendto)r0r flags_or_addrrrs r/r@zSSLSocket.sendtos^  << #D!^^,- - \7>$ 6 67>$ t< rsendall) r0rrrview byte_viewamountrrs r/rIzSSLSocket.sendalls  << #z LNN#$$ED!T499S>YYfn )EF"34AQJEfn,:!! 7?4/ / ,:>!!s$B7/B+ B7+B4 0B77Ccf |j|j|||St| |||Sr)r_sendfile_use_sendrsendfile)r0fileoffsetrrs r/rOzSSLSocket.sendfiles?  << #**4? ?7#D&%8 8r1c|j|j.|dk7rtd|jz|j |St |||S)Nrz3non-zero flags not allowed in calls to recv() on %s)r0rrrrrrr0buflenrrs r/rzSSLSocket.recvs^  << #z INN#$$99V$ $7<. .r1c*|j|)|%t|5}|j}ddd|sd}nd}|j/|dk7rt d|j z|j ||St|!|||S#1swY\xYw)Nrrz8non-zero flags not allowed in calls to recv_into() on %s) r0rGnbytesrrrrr recv_into)r0rrVrrJrs r/rWzSSLSocket.recv_intos  >!'4![[F(!F << #z L..!""99VV, ,7$VVU; ;('s B  Bc|j|jtd|jzt|||S)Nz'recvfrom not allowed on instances of %s)r0rrrrrecvfromrSs r/rYzSSLSocket.recvfromsI  << #F!^^,- -7#FE2 2r1c|j|jtd|jzt||||S)Nz,recvfrom_into not allowed on instances of %s)r0rrrr recvfrom_into)r0rrVrrs r/r[zSSLSocket.recvfrom_intosK  << #K!^^,- -7(? ?r1c2td|jz)Nz&recvmsg not allowed on instances of %srCrs r/recvmsgzSSLSocket.recvmsgs!"J"&..#12 2r1c2td|jz)Nz+recvmsg_into not allowed on instances of %srCrs r/ recvmsg_intozSSLSocket.recvmsg_intos !#')-#89 9r1cp|j|j|jjSyNr)r0rrrs r/rzSSLSocket.pendings.  << #<<'') )r1cR|jd|_t| |yr)r0rrr)r0howrs r/rzSSLSocket.shutdowns#   r1c|jr#|jj}d|_|Stdt|zNzNo SSL wrapper around )rrrr5)r0ss r/rzSSLSocket.unwrap s< << %%'ADLH5D AB Br1c||jr|jjStdt|zre)rrrr5rs r/rz&SSLSocket.verify_client_post_handshakes1 <<<<<<> >5D AB Br1c0d|_t| yr)rr _real_closerzs r/rizSSLSocket._real_closes  r1c|j|j} |dk(r|r|jd|jj |j|y#|j|wxYw)Nr )r2r rrr)r0blockr&s r/rzSSLSocket.do_handshake s] //# %#~%% LL % % ' OOG $DOOG $s 2A&&A9c|jr td|js |j td|jj |d|j ||j|_ |rt|%|}nd}t|)||s#d|_|jr|j|S#ttf$r d|_wxYw)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!Fr T)r;rrrr?rr>rr connect_exconnectr<rr)r0rrmrcrs r/ _real_connectzSSLSocket._real_connect+s   @A A ??dll6NO O||00 %-- 1   W'-%"&//%%'I$ DL  s 6A CCc* |j|dy)NFrpr0rs r/rnzSSLSocket.connectEs  4'r1c( |j|dSrrrrss r/rmzSSLSocket.connect_exJs !!$--r1c t|\}}|jj||j|j d}||fS)NT)r<r=r;)racceptr?rCr<r=)r0newsockrrs r/rvzSSLSocket.acceptOsV >( ,,**7,0,H,H)-)B)B $+&}r1c|j|jj|S|tvrtdj |y)Nz({0} channel binding type not implemented)rrCHANNEL_BINDING_TYPESrrrs r/rzSSLSocket.get_channel_binding[sJ << #<<33G< <33 >EEgNr1cP|j|jjSyrrrs r/rzSSLSocket.versionfs" << #<<'') )r1)FTTNNNrrr)r)rN)rrrar)/rErFrGrrrBrrr?rr@rr-r0r2rrrrrrrrr>r@rDrIrOrrWrYr[r]r_rrrrrirrprnrmrvrrrrs@r/rrs; FJ;?&*\\| ^^##(( ^^++ //; *(55 99))11.. -=2 0 9 /<&3@29 CCCC %%4( . r1rc ddlm}ddlm}d}d} |j |ddj dz}||dd|}||d|f|dd zS#t $rt d |d |d wxYw) Nr)strptime)timegm) JanFebMarAprMayJunJulAugSepOctNovDecz %d %H:%M:%S %Y GMTrrrrz time data z does not match format "%b")timer|calendarr}indextitler) cert_timer|r}months time_format month_numbertts r/cert_time_to_secondsrusF(K 7||IbqM$7$7$9:Q> im[ 1r!ul+b1g566 F-6 EF FFs %AA3z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----c ttj|dd}tg}|t dt |dDcgc] }|||dz c}z }|j tdzdj|Scc}w)NASCIIstrictr@ ) r5base64standard_b64encode PEM_HEADERrangerOrP PEM_FOOTERjoin)der_cert_bytesfssis r/DER_cert_to_PEM_certrs& F % %n 5wIA BeAs1vr2 321Qqt92 33BIIj4 99R= 4sA?cb |jtstdtz|jj t stdt z|jt tt t  }tj|jddS)Nz(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %srr) r,rrstripendswithrrOr decodebytesr6)pem_cert_stringds r/PEM_cert_to_DER_certrs4  % %j 1C%&' '  " + +J 7A%&' 'JZ0@AA   ahhw9 ::r1c( |\}}|t}nt}t|||}t||5}|j ||5} | j d} ddddddt  S#1swYxYw#1swYt  SxYw)N)rr)r&)r>T)rr_create_stdlib_contextrrCrr) r ssl_versionca_certsr&hostportrr?r:sslsockdercerts r/get_server_certificatersJD$!  $[/8,46G 4 1T  t <))$/G= 2  ((= < 2  ((s#A>A2A>2A; 7A>>Bc.tj|dS)Nz )_PROTOCOL_NAMESr) protocol_codes r/get_protocol_namers   }k ::r1r)lrsr collectionsrenumr_Enumr_IntEnumr_IntFlagrrHrr r r r r rrrrrrrrrrrrrrr ImportErrorrrrrrr r!r"r#r$r%r& _convert_rEr'r,r* __members__itemsrr_SSLv2_IF_EXISTSrDrYrgrrtrrrrrrrrrrrr)r socket_errorryrHAS_NEVER_CHECK_COMMON_NAME_RESTRICTED_SERVER_CIPHERSrrrrrrr rr#r rrr_create_default_https_contextrrrrrArErrrrrrrr)r.rs00r/rsaXt "HH NN33:22  8(K   x'  6  h.  8+  ()  0:/F/FF*,2<2H2H2N2N2PQ2P;45$;2PQ:'7>h555h   h&"&"&"Rh   :<<7199??  %%d,JK.+.>b DF  4 &@*],HI@*&k5&AGAGH$+#6#6$$"&t$L49*/9L9L$($"&tD4n!74X;X;v ||@' &  7<+ (  ;.A$(2I),;g*  TRsJ%= J1%J.-J.