Files
952-11/env/python/dll/Python312/Lib/__pycache__/ssl.cpython-312.pyc
T

422 lines
62 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åfKÌã
óp—dZddlZddlZddlmZddlmZmZ m
Z ddlm Z ddl
Z
ddl
mZmZmZddl
mZmZmZddl
mZmZmZmZmZmZmZdd l
mZmZdd
l
mZm Z m!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/e j`de1d„e
¬«e j`de1d„e
¬«e j`de1d„e
¬«e j`de1d„e
¬«e j`de1d„e
¬«e j`de1d„e
¬«e2jfxZ4e2_4e2jjjm«D��cic]\}}||“Œ
c}}Z7e8e2dd«Z9e e «Gd„d««Z:e e «Gd„d««Z;e e «Gd „d!««Z<e e «Gd"„d#««Z=ej|d$k(rdd%l
m?Z?m@Z@dd&lAmAZAmBZBmCZCdd'lAmDZDmEZEmFZFddlAZGddlHZHddlIZIddlJZJeKZLd(gZMeNe
d)«ZOe.ZPeZQd*„ZRd+„ZSd,„ZTed-d.«ZUd/„ZVGd0„d1ed1d2««ZWGd3„d4eWe«ZXGd5„d6e«ZYeXj´fdddd7œd8„Z[dHe\d9eXj´dddddd:œd;„Z]e[Z^e]Z_Gd<„d=«Z`d>„ZaGd?„d@eA«ZbebeY_ce`eY_ddA„ZedBZfdCZgdD„ZhdE„ZiejdeFfdF„ZkdG„Zly#e#$rY�ŒJwxYwcc}}w)Iañ
This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O errors
Functions:
cert_time_to_seconds -- convert time string used for certificate
notBefore and notAfter functions to integer
seconds past the Epoch (the time values
returned from time.time())
get_server_certificate (addr, ssl_version, ca_certs, timeout) -- Retrieve the
certificate from the server at the specified
address and return it as a PEM-encoded string
Integer constants:
SSL_ERROR_ZERO_RETURN
SSL_ERROR_WANT_READ
SSL_ERROR_WANT_WRITE
SSL_ERROR_WANT_X509_LOOKUP
SSL_ERROR_SYSCALL
SSL_ERROR_SSL
SSL_ERROR_WANT_CONNECT
SSL_ERROR_EOF
SSL_ERROR_INVALID_ERROR_CODE
The following group define certificate requirements that one side is
allowing/requiring from the other side:
CERT_NONE - no certificates from the other side are required (or will
be looked at if provided)
CERT_OPTIONAL - certificates are not required, but if provided will be
validated, and if validation fails, the connection will
also fail
CERT_REQUIRED - certificates are required, and will be validated, and
if validation fails, the connection will also fail
The following constants identify various SSL protocol variants:
PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLS
PROTOCOL_TLS_CLIENT
PROTOCOL_TLS_SERVER
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2
The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6
ALERT_DESCRIPTION_CLOSE_NOTIFY
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
ALERT_DESCRIPTION_BAD_RECORD_MAC
ALERT_DESCRIPTION_RECORD_OVERFLOW
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_BAD_CERTIFICATE
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
ALERT_DESCRIPTION_CERTIFICATE_REVOKED
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
ALERT_DESCRIPTION_ILLEGAL_PARAMETER
ALERT_DESCRIPTION_UNKNOWN_CA
ALERT_DESCRIPTION_ACCESS_DENIED
ALERT_DESCRIPTION_DECODE_ERROR
ALERT_DESCRIPTION_DECRYPT_ERROR
ALERT_DESCRIPTION_PROTOCOL_VERSION
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
ALERT_DESCRIPTION_INTERNAL_ERROR
ALERT_DESCRIPTION_USER_CANCELLED
ALERT_DESCRIPTION_NO_RENEGOTIATION
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
ALERT_DESCRIPTION_UNRECOGNIZED_NAME
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
éN)Ú
namedtuple)ÚEnumÚIntEnumÚIntFlag)Ú _simple_enum)ÚOPENSSL_VERSION_NUMBERÚOPENSSL_VERSION_INFOÚOPENSSL_VERSION)Ú _SSLContextÚ MemoryBIOÚ
SSLSession)ÚSSLErrorÚSSLZeroReturnErrorÚSSLWantReadErrorÚSSLWantWriteErrorÚSSLSyscallErrorÚ SSLEOFErrorÚSSLCertVerificationError)Útxt2objÚnid2obj)Ú RAND_statusÚRAND_addÚ
RAND_bytes)ÚRAND_egd)
ÚHAS_SNIÚHAS_ECDHÚHAS_NPNÚHAS_ALPNÚ HAS_SSLv2Ú HAS_SSLv3Ú HAS_TLSv1Ú HAS_TLSv1_1Ú HAS_TLSv1_2Ú HAS_TLSv1_3)Ú_DEFAULT_CIPHERSÚ_OPENSSL_API_VERSIONÚ
_SSLMethodcó2—|jd«xr|dk7S)NÚ PROTOCOL_ÚPROTOCOL_SSLv23©Ú
startswith©Únames ú?C:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\ssl.pyú<lambda>r0}s€�—‘ Ó-ÒK°$Ð:KÑ2K€ó)ÚsourceÚOptionscó$—|jd«S)NÚOP_r+r-s r/r0r0‚s€�—‘ Ó'€r1ÚAlertDescriptioncó$—|jd«S)NÚALERT_DESCRIPTION_r+r-s r/r0r0‡s€�—‘Ð!5Ó6€r1ÚSSLErrorNumbercó$—|jd«S)NÚ
SSL_ERROR_r+r-s r/r0r0Œs€�—‘ Ó.€r1Ú VerifyFlagscó$—|jd«S)NÚVERIFY_r+r-s r/r0r0‘s€�—‘ Ó+€r1Ú
VerifyModecó$—|jd«S)NÚCERT_r+r-s r/r0r0–s€�—‘ Ó)€r1ÚPROTOCOL_SSLv2có´—eZdZejZej ZejZ ejZ ejZ
ejZej Zy)Ú
TLSVersionN)Ú__name__Ú
__module__Ú __qualname__Ú_sslÚPROTO_MINIMUM_SUPPORTEDÚMINIMUM_SUPPORTEDÚ PROTO_SSLv3ÚSSLv3Ú PROTO_TLSv1ÚTLSv1Ú
PROTO_TLSv1_1ÚTLSv1_1Ú
PROTO_TLSv1_2ÚTLSv1_2Ú
PROTO_TLSv1_3ÚTLSv1_3ÚPROTO_MAXIMUM_SUPPORTEDÚMAXIMUM_SUPPORTED©r1r/rDrDŸsQ„à×4Ñ4ÐØ × Ñ €EØ × Ñ €EØ× Ñ €GØ× Ñ €GØ× Ñ €GØ×4Ñ4Ñr1rDcó(—eZdZdZdZdZdZdZdZdZ y) Ú_TLSContentTypez@Content types (record layer)
See RFC 8446, section B.1
ééééééN)
rErFrGÚ__doc__ÚCHANGE_CIPHER_SPECÚALERTÚ HANDSHAKEÚAPPLICATION_DATAÚHEADERÚINNER_CONTENT_TYPErWr1r/rYrYªs*„ñðÐØ €EØ€IØÐà
€FØÑr1rYcó˜—eZdZdZdZdZdZdZdZdZ dZ
d Z d
Z d Z
d Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%y$)%Ú
_TLSAlertTypezQAlert types for TLSContentType.ALERT messages
See RFC 8466, section B.2
ré
rZr[r\éé(é)é*é+é,é-é.é/é0é1é2é3é<éFéGéPéVéZédéménéoépéqérésétéxN)&rErFrGr`Ú CLOSE_NOTIFYÚUNEXPECTED_MESSAGEÚBAD_RECORD_MACÚDECRYPTION_FAILEDÚRECORD_OVERFLOWÚDECOMPRESSION_FAILUREÚHANDSHAKE_FAILUREÚNO_CERTIFICATEÚBAD_CERTIFICATEÚUNSUPPORTED_CERTIFICATEÚCERTIFICATE_REVOKEDÚCERTIFICATE_EXPIREDÚCERTIFICATE_UNKNOWNÚILLEGAL_PARAMETERÚ
UNKNOWN_CAÚ
ACCESS_DENIEDÚ DECODE_ERRORÚ
DECRYPT_ERRORÚEXPORT_RESTRICTIONÚPROTOCOL_VERSIONÚINSUFFICIENT_SECURITYÚINTERNAL_ERRORÚINAPPROPRIATE_FALLBACKÚ
USER_CANCELEDÚNO_RENEGOTIATIONÚMISSING_EXTENSIONÚUNSUPPORTED_EXTENSIONÚCERTIFICATE_UNOBTAINABLEÚUNRECOGNIZED_NAMEÚBAD_CERTIFICATE_STATUS_RESPONSEÚBAD_CERTIFICATE_HASH_VALUEÚUNKNOWN_PSK_IDENTITYÚCERTIFICATE_REQUIREDÚNO_APPLICATION_PROTOCOLrWr1r/rhrh¹sÊ„ñð€LØÐØ€NØÐØ€OØÐØÐØ€NØ€OØ ÐØÐØÐØÐØÐØ€JØ€MØ€LØ€MØÐØÐØÐØ€NØÐØ€MØÐØÐØÐØ"ÐØÐØ&)Ð#Ø!$ÐØÐØÐØ!Ñr1rhcóh—eZdZdZdZdZdZdZdZdZ dZ
d Z d
Z d Z
d Zd
ZdZdZdZdZdZdZdZdZdZdZy)Ú_TLSMessageTypezFMessage types (handshake protocol)
See RFC 8446, section B.3
réééééééé é é
ééérZr[r\r]ééCéþr_N)rErFrGr`Ú
HELLO_REQUESTÚ CLIENT_HELLOÚ SERVER_HELLOÚHELLO_VERIFY_REQUESTÚNEWSESSION_TICKETÚEND_OF_EARLY_DATAÚHELLO_RETRY_REQUESTÚENCRYPTED_EXTENSIONSÚ CERTIFICATEÚSERVER_KEY_EXCHANGEÚCERTIFICATE_REQUESTÚ SERVER_DONEÚCERTIFICATE_VERIFYÚCLIENT_KEY_EXCHANGEÚFINISHEDÚCERTIFICATE_URLÚCERTIFICATE_STATUSÚSUPPLEMENTAL_DATAÚ
KEY_UPDATEÚ
NEXT_PROTOÚ MESSAGE_HASHrarWr1r/rªrªãsƒ„ñð€MØ€LØ€LØÐØÐØÐØÐØÐØ€KØÐØÐØ€KØÐØÐØ€HØ€OØÐØÐØ€JØ€JØ€LØÑr1rªÚwin32)Úenum_certificatesÚ enum_crls)ÚsocketÚ SOCK_STREAMÚcreate_connection)Ú
SOL_SOCKETÚSO_TYPEÚ_GLOBAL_DEFAULT_TIMEOUTú
tls-uniqueÚHOSTFLAG_NEVER_CHECK_SUBJECTcó—|sy|jd«}|s!|j«|j«k(S|dkDrtdj|««‚|j d«\}}}d|vrtdj|««‚|stdj|««‚|dk7rtdj|««‚|j d«\}}}|r|sy|j«|j«k(S) a¤Matching according to RFC 6125, section 6.4.3
- Hostnames are compared lower-case.
- For IDNA, both dn and hostname must be encoded as IDN A-label (ACE).
- Partial wildcards like 'www*.example.org', multiple wildcards, sole
wildcard or wildcards in labels other then the left-most label are not
supported and a CertificateError is raised.
- A wildcard must match at least one character.
FÚ*r«z1too 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}.z<partial wildcards in leftmost label are not supported: {!r}.)ÚcountÚlowerÚCertificateErrorÚformatÚ partition)ÚdnÚhostnameÚ wildcardsÚ dn_leftmostÚsepÚ dn_remainderÚhostname_leftmostÚhostname_remainders r/Ú_dnsname_matchrës€ñ Øà—‘˜“
€Iá Ø�x‰x‹z˜XŸ^™^Ó-Ñ-Ð-à�1‚}ÜØ ?× FÑ FÀrÓ JóLð Lð&(§\¡\°#Ó%6Ñ"€K��là
ˆlÑäð
ß‘F˜2“Jó ð ñ äð
ß‘F˜2“Jó ð ð�cÒäð
ß‘F˜2“Jó ð ð2:×1CÑ1CÀCÓ1HÑ.Ð�sÐ.Ù ¡CàØ × Ñ Ó Ð#5×#;Ñ#;Ó#=Ñ =Ð=r1có”— tj|«}tj|«|k(r|Stdj |««‚#t
$rYnwxYw tj tj|«S#t
$rtdj |««‚t$rYnwxYwtdj |««‚)z’Try to convert an IP address to packed binary form
Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6
support.
z'{!r} is not a quad-dotted IPv4 address.z+{!r} is neither an IPv4 nor an IP6 address.z{!r} is not an IPv4 address.) Ú_socketÚ inet_atonÚ inet_ntoaÚ
ValueErrorráÚOSErrorÚ inet_ptonÚAF_INET6ÚAttributeError)ÚipnameÚaddrs r/Ú _inet_patonr÷Is΀ð
Ü× Ñ  Ó(ˆô
× Ñ ˜TÓ " fÒ ,àˆKôØ9×@Ñ@ÀÓHóð
øô ò
á ð
úð
Ü× Ñ ¤×!1Ñ!1°6Ó:Ð:øÜ ò4Üð$ß$*¡F¨6£Nó4ð 4ä ò
á ð
úô Ð3×:Ñ:¸6ÓBÓ
CÐCs#‚A Á AÁAÁ#A?Á?+B-Â,B-có>—t|j««}||k(S)zˆExact matching of IP addresses.
RFC 6125 explicitly doesn't define an algorithm for this
(section 1.7.2 - "Out of Scope").
)r÷Úrstrip)Úcert_ipaddressÚhost_ipÚips r/Ú_ipaddress_matchrýls!€ô
�^×*Ñ*Ó,Ó -€BØ
�‰=Ðr1ÚDefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcó`—tj«}tjj |d|d«}tjj |d|d«}t tj j|«r|ndtj j|«r|ndg|¢­ŽS)z/Return paths to default cafile and capath.
rr«r¬r­N) rHÚget_default_verify_pathsÚosÚenvironÚgetrþÚpathÚisfileÚisdir)ÚpartsÚcafileÚcapaths r/rr|sˆ€ô
× )Ñ )Ó +€Eô�Z‰Z�^‰^˜E !™H e¨A¡hÓ
/€FÜ
�Z‰Z�^‰^˜E !™H e¨A¡hÓ
/€Fä ¬¯©¯©°vÔ(>™fÀDÜ(*¯©¯
©
°fÔ(=™fÀ4ð &à$ò &ð&r1cóN‡—eZdZdZdZˆfd„Zeˆfd„«Zeˆfd„«ZˆxZ S)Ú _ASN1Objectz#ASN.1 object identifier lookup
rWcó:•—t‰|�|gt|d¬«¢­ŽS)NFr-©ÚsuperÚ__new__Ú_txt2obj)ÚclsÚoidÚ __class__s €r/rz_ASN1Object.__new__�sø€Ü‰w‰˜sÐ?¤X¨c¸Ô%>Ò?Ð?r1có6•—t‰|�|gt|«¢­ŽS)z3Create _ASN1Object from OpenSSL numeric ID
)rrÚ_nid2obj)rÚnidrs €r/Úfromnidz_ASN1Object.fromnid’sø€ô‰w‰˜sÐ3¤X¨c£]Ò3Ð3r1có:•—t‰|�|gt|d¬«¢­ŽS)z=Create _ASN1Object from short name, long name or OID
Tr-r
)rr.rs €r/Úfromnamez_ASN1Object.fromname˜s ø€ô‰w‰˜sÐ?¤X¨d¸Ô%>Ò?Ð?r1)
rErFrGr`Ú __slots__rÚ classmethodrrÚ
__classcell__©rs@r/r r Šs=ø„ñà€Iô@ðó4óð4ð
ó@óô@r1r znid shortname longname oidcó—eZdZdZdZdZy)ÚPurposezDSSLContext purpose flags with X509v3 Extended Key Usage objects
z1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)rErFrGr`Ú SERVER_AUTHÚ CLIENT_AUTHrWr1r/rrŸs„ñà%€KØ%�Kr1rcój‡—eZdZdZdZdZdZdd„Zd„Z d d„Z d!d„Z
d„Z d „Z d
„Z
d „Zej fd „Zeed
«r<eˆfd„«Zej,ˆfd„«Zeˆfd„«Zej,ˆfd„«Zeˆfd„«Zej,ˆfd„«Zeed«red„«Zej,d„«Zned„«Zeˆfd„«Zej,ˆfd„«Zeˆfd„«Zeˆfd„«Zej,ˆfd„«Zeˆfd„«Zej,ˆfd„«ZˆxZS)"Ú
SSLContextz|An SSLContext holds various SSL-related configuration options and
data, such as certificates and possibly a private key.)ÚCAÚROOTNcóz—|€"tjdtd¬«t}t j
||«}|S)Nz9ssl.SSLContext() without protocol argument is deprecated.r¬)ÚcategoryÚ
stacklevel)ÚwarningsÚwarnÚDeprecationWarningÚ PROTOCOL_TLSr r)rÚprotocolÚargsÚkwargsÚselfs r/rzSSLContext.__new__®s;€Ø Ð Ü �M‰MØKÜ+Øõ
ô
$ˆHÜ×"Ñ" 3¨Ó1ˆØˆ r1cóŠ—|€yt|t«r |jd«jd«S|jd«S)NÚidnaÚascii)Ú
isinstanceÚstrÚencodeÚdecode)r0räs r/Ú_encode_hostnamezSSLContext._encode_hostname¹s>€Ø Ð ØÜ
˜¤#Ô
&Ø—?‘? 6Ó*×1Ñ1°'Ó:Ð :à—?‘? 7Ó+Ð +r1c óF—|jj|||||||¬«S)N)ÚsockÚ server_sideÚdo_handshake_on_connectÚsuppress_ragged_eofsÚserver_hostnameÚcontextÚsession)Ússlsocket_classÚ_create)r0r:r;r<r=r>r@s r/Ú wrap_socketzSSLContext.wrap_socketÁs7€ð ×#Ñ#×+Ñ+ØØ#Ø$;Ø!5Ø+ØØð,ó
ð
r1cób—|jj||||j|«||¬«S)N)r;r>r@r?)Ússlobject_classrBr8)r0ÚincomingÚoutgoingr;r>r@s r/Úwrap_biozSSLContext.wrap_bioÑs<€ð×#Ñ#×+Ñ+Ø �h¨KØ ×1Ñ1°/ÓBØ Tð,ó
ð
r1có<—tjdtd¬«t«}|D]`}t |d«}t |«dk(st |«dkDr t
d«‚|jt |««|j|«Œb|j|«y)Nú'ssl NPN is deprecated, use ALPN insteadr¬©r(r3réÿz(NPN protocols must be 1 to 255 in length)
r)r*r+Ú bytearrayÚbytesÚlenrÚappendÚextendÚ_set_npn_protocols)r0Ú
npn_protocolsÚprotosr-Úbs r/Úset_npn_protocolszSSLContext.set_npn_protocolsÛsˆ€Ü�
‰
Ø 5Ü Øõ
ô
“ˆØ%ò ˆHÜ�h Ó(ˆAÜ�1‹v˜Š{œc !›f sšlÜÐIÓJÐJØ �M‰Mœ#˜a›&Ô !Ø �M‰M˜!Õ ð  ð
×Ñ Õ'r1cób‡‡—‰€d‰_yt‰«s td«‚ˆˆfd„}|‰_y)Nznot a callable objectcó:•—‰j|«}‰|||«S©N)r8)ÚsslobjÚ
servernameÚsslctxr0Úserver_name_callbacks €€r/Úshim_cbz3SSLContext.set_servername_callback.<locals>.shim_cbòs"ø€Ø!×2Ñ2°:Ó>�
Ù+¨F°JÀÓGÐGr1)Ú sni_callbackÚcallableÚ TypeError)r0r]r^s`` r/Úset_servername_callbackz"SSLContext.set_servername_callbackës6ù€Ø Ð 'Ø $ˆDÕ äÐ0Ô1ÜÐ 7Ó8Ð8õ
Hð!(ˆDÕ r1có—t«}|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)r0Úalpn_protocolsrTr-rUs r/Úset_alpn_protocolszSSLContext.set_alpn_protocolsøsq€Ü“ˆØ&ò ˆHÜ�h Ó(ˆAÜ�1‹v˜Š{œc !›f sšlÜÐJÓKÐKØ �M‰Mœ#˜a›&Ô !Ø �M‰M˜!Õ ð  ð
× Ñ  Õ(r1có
—t«} t|«D]0\}}}|dk(sŒ
|dus|j|vsŒ |j|«Œ2 |r|j|¬«|S#t$rt j d«YŒ6wxYw)NÚx509_asnTz-unable to enumerate Windows certificate store)Úcadata)rMrÑrrQÚPermissionErrorr)r*Úload_verify_locations)r0Ú storenameÚpurposeÚcertsÚcertÚencodingÚtrusts r/Ú_load_windows_store_certsz$SSLContext._load_windows_store_certss‹€Ü“ ˆð KÜ):¸9Ó)Eò
+Ñ%��h à˜zÓ)Ø ‘}¨¯ © °uÒ(<ØŸ ™  TÕ*ñ 
+ñ Ø × &Ñ &¨eÐ &Ô 4؈ øô ò KÜ �M‰MÐIÖ Jð KúsŒA!¤A!·A!Á!BÂBcóÆ—t|t«s t|«‚tjdk(r#|j
D]}|j
||«Œ|j«y)NrÐ)r4r raÚsysÚplatformÚ_windows_cert_storesrrÚset_default_verify_paths)r0rmrls r/Úload_default_certszSSLContext.load_default_certssV€Ü˜'¤;Ô/ܘGÓ$Ð $Ü �<‰<˜7Ò "Ø!×6Ñ6ò
C� Ø×.Ñ.¨y¸'ÕBð
Cà ×%Ñ%Õ'r1Úminimum_versioncó*•—tt‰|�«SrY)rDrry©r0rs €r/ryzSSLContext.minimum_versionóø€äœe™gÑ5Ó6Ð 6r1c󸕗|tjk(r$|xjtjzc_t
t t �j||«yrY) rDrLÚoptionsr3Ú OP_NO_SSLv3rr#ryÚ__set__©r0Úvaluers €r/ryzSSLContext.minimum_versions?ø€àœ
×(Ñ(Ò(Ø— ’ ¤×!4Ñ!4Ð 4Ñ4• Ü ”*œjÑ 9× AÑ AÀ$ÈÕ Nr1có*•—tt‰|�«SrY)rDrÚmaximum_versionr{s €r/r„zSSLContext.maximum_version$r|r1cóJ•—ttt�
j||«yrY)rr#r„r€r�s €r/r„zSSLContext.maximum_version(sø€ä ”*œjÑ 9× AÑ AÀ$ÈÕ Nr1có*•—tt‰|�«SrY)r3rr~r{s €r/r~zSSLContext.options,sø€ä”u‘w‘Ó'Ð'r1cóJ•—ttt�
j||«yrY)rr#r~r€r�s €r/r~zSSLContext.options0sø€ä
Œjœ*Ñ-×5Ñ5°d¸EÕBr1rÚcób—|jtjz}|tjk7SrY©Ú _host_flagsrHrÚ)r0Úncss r/Úhostname_checks_common_namez&SSLContext.hostname_checks_common_name5s)€à×"Ñ"¤T×%FÑ%FÑFˆCØœ$×;Ñ;Ñ;Ð ;r1có˜—|r%|xjtjzc_y|xjtjzc_yrYr‰)r0r‚s r/rŒz&SSLContext.hostname_checks_common_name:s6€áØ× Ò ¤T×%FÑ%FÐ$FÑFÖ à× Ò ¤D×$EÑ$EÑEÖ r1có—y)NTrW©r0s r/rŒz&SSLContext.hostname_checks_common_nameAs€àr1có6•—t‰|�}|� |jSy)a9TLS message callback
The message callback provides a debugging hook to analyze TLS
connections. The callback is called for any TLS protocol message
(header, handshake, alert, and more), but not for application data.
Due to technical limitations, the callback can't be used to filter
traffic or to abort a connection. Any exception raised in the
callback is delayed until the handshake, read, or write operation
has been performed.
def msg_cb(conn, direction, version, content_type, msg_type, data):
pass
conn
:class:`SSLSocket` or :class:`SSLObject` instance
direction
``read`` or ``write``
version
:class:`TLSVersion` enum member or int for unknown version. For a
frame header, it's the header version.
content_type
:class:`_TLSContentType` enum member or int for unsupported
content type.
msg_type
Either a :class:`_TLSContentType` enum number for a header
message, a :class:`_TLSAlertType` enum member for an alert
message, a :class:`_TLSMessageType` enum member for other
messages, or int for unsupported message types.
data
Raw, decrypted message content as bytes
N)rÚ
_msg_callbackÚ
user_function)r0Úinnerrs €r/r‘zSSLContext._msg_callbackEs%ø€ôB‘Ñ%ˆØ Ð Ø×&Ñ&Ð &àr1có╇—‰€#ttt�
j|d«yt ‰d«st ‰›d�«‚ˆfd„}‰|_ttt�
j||«y)NÚ__call__z is not callable.có.•— t|«} t|«}|tjk(rt}n |tjk(rt
}nt } ||«}‰||||||«S#t$rYŒgwxYw#t$rYŒjwxYw#t$rYŒ6wxYwrY)rDrðrYrerbrhrª)ÚconnÚ directionÚversionÚ content_typeÚmsg_typeÚdataÚmsg_enumÚcallbacks €r/r“z'SSLContext._msg_callback.<locals>.innerus³ø€ð
Ü$ WÓ-�ð
Ü.¨|Ó<� ðœ×5Ñ5Ò5Ü*‘ؤ×!6Ñ!6Ò6Ü(‘ä*�ð
Ù# HÓ-�ñ˜D )¨WØ(¨(°Dó:ð
:øô'ò
Ùð
ûô
ò
Ùð
ûôò
Ùð
ús4ƒ A*� A9ÁBÁ* A6Á5A6Á9 BÂB BÂB)rr#r‘r€Úhasattrrar’)r0ržr“rs ` €r/r‘zSSLContext._msg_callbacklsfù€à Ð Ü ”*œjÑ 7× ?Ñ ?ÀÀdÔ KØ ä�x Ô,ܘx˜jÐ(9Ð:Ó;Ð ;ô :ð2'ˆÔä
Œjœ*Ñ3×;Ñ;¸DÀ%ÕHr1có*•—tt‰|�«SrY)r'rr-r{s €r/r-zSSLContext.protocol’sø€äœ%™'Ñ*Ó+Ð+r1có*•—tt‰|�«SrY)r<rÚ verify_flagsr{s €r/r¢zSSLContext.verify_flags–sø€äœ5™7Ñ/Ó0Ð0r1cóJ•—ttt�
j||«yrY)rr#r¢r€r�s €r/r¢zSSLContext.verify_flagsšsø€ä
Œjœ*Ñ2×:Ñ:¸4ÀÕGr1cóR•—t‰|�} t|«S#t$r|cYSwxYwrY)rÚ verify_moder?rðr�s €r/r¥zSSLContext.verify_modežs1ø€ä‘Ñ#ˆð ܘeÓ$Ð $øÜò ØŠLð ús �
˜ &¥&cóJ•—ttt�
j||«yrY)rr#r¥r€r�s €r/r¥zSSLContext.verify_mode¦sø€ä
Œjœ*Ñ1×9Ñ9¸$ÀÕFr1rY)FTTNN)FNN) rErFrGr`rvrArErr8rCrHrVrbrfrrrr rxrŸr ÚpropertyryÚsetterr„r~rHrŒr‘r-r¢r¥rrs@r/r#r#¦sôø„ñ>à)Ðà€OØ€Oó ò,ð-2Ø,0Ø)-Ø26ó
ð 8=Ø/3ó
ò(ò (ò )ò ð*1×)<Ñ)<ó(ñˆ{Ð-Ô.Ø ó 7ó
ð 7ð
× Ñ ó Oó
ð Oð
ó 7ó
ð 7ð
× Ñ ó Oó
ð Oðó(óð(ð
‡^�^óCóðCñˆtÐ3Ô4Ø ñ <ó
ð <ð
%× +Ñ +ñ Fó
,ñ Fð
ñ ó
ð ðó$óð$ðL×Ñó#Ióð#IðJó,óð,ðó1óð1ð×ÑóHóðHðóóðð×ÑóGóôGr1r#)rr ricó—t|t«s t|«‚|tjk(r"t t «}t|_d|_ n.|tjk(rt t«}n t|«‚|s|s|r|j|||«n$|jtk7r|j|«t!|d«rBt"j$j'd«}|r!t(j*j,s||_|S)zíCreate a SSLContext object with default settings.
NOTE: The protocol and settings may change anytime without prior
deprecation. The values represent a fair balance between maximum
compatibility and security.
TÚkeylog_filenameÚ
SSLKEYLOGFILE)r4r rarr r#ÚPROTOCOL_TLS_CLIENTÚ
CERT_REQUIREDr¥Úcheck_hostnamer!ÚPROTOCOL_TLS_SERVERrðrkÚ CERT_NONErxrŸrrrrtÚflagsÚignore_environmentrª)rmrr rir?Ú
keylogfiles r/Úcreate_default_contextr´«sØ€ô �gœ{Ô +Ü˜Ó Ð ð
”'×%Ñ%Ò%äÔ0Ó1ˆÜ+ˆÔØ!%ˆÕØ ”G×'Ñ'Ò 'ÜÔ0Ó1‰ä˜Ó!Ð!á
‘™6Ø×%Ñ% f¨f°fÕ=Ø × Ñ ¤ Ò )ð ×"Ñ" 7Ô+äˆwÐ)Ô*Ü—Z‘Z—^‘^ OÓ4ˆ
Ù œcŸi™i×:Ò:Ø&0ˆGÔ #Ø €Nr1F)Ú cert_reqsr®rmÚcertfileÚkeyfilerr ricól—t|t«s 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!| d«rBt"j$j'd«}
|
r!t(j*j,s|
| _| S)a/Create a SSLContext object for Python stdlib modules
All Python stdlib modules shall use this function to create SSLContext
objects in order to keep common settings in one place. The configuration
is less restrict than create_default_context()'s to increase backward
compatibility.
Tzcertfile must be specifiedrªr«)r4r rarr r¬r!r¯rðr#r®r¥Úload_cert_chainrkr°rxrŸrrrrtr±r²rª) r-rµr®rmr¶r·rr rir?r³s r/Ú_create_unverified_contextrºÑs€ô �gœ{Ô +Ü˜Ó Ð ð
”'×%Ñ%Ò%à Ð Ü*‰HØ ”G×'Ñ'Ò 'Ø Ð Ü*‰Hä˜Ó!Ð!ä˜Ó"€GØ+€GÔØÐØ'ˆÔÙØ!%ˆÔá‘xÜÐ5Ó6Ð6Ù‘7Ø×Ñ ¨'Ô2ñ‘™6Ø×%Ñ% f¨f°fÕ=Ø × Ñ ¤ Ò )ð ×"Ñ" 7Ô+äˆwÐ)Ô*Ü—Z‘Z—^‘^ OÓ4ˆ
Ù œcŸi™i×:Ò:Ø&0ˆGÔ #Ø €Nr1có—eZdZdZd„Ze dd„«Zed„«Zejd„«Zed„«Z
e
jd„«Z
ed „«Z ed
„«Z ed „«Z
dd „Zd
„Zdd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Zy)Ú SSLObjectaThis class implements an interface on top of a low-level SSL object as
implemented by OpenSSL. This object captures the state of an SSL connection
but does not provide any network IO itself. IO needs to be performed
through separate "BIO" objects which are OpenSSL's IO abstraction layer.
This class does not have a public constructor. Instances are returned by
``SSLContext.wrap_bio``. This class is typically used by framework authors
that want to implement asynchronous IO for SSL through memory buffers.
When compared to ``SSLSocket``, this object lacks the following features:
* Any form of network IO, including methods such as ``recv`` and ``send``.
* The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery.
cóF—t|jj›d�«‚)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().©rarrE©r0r.r/s r/Ú__init__zSSLObject.__init__s+€ÜØ�~‰~×&Ñ&Ð'ð(Lð
Mó
ð
r1Ncód—|j|«}|j||||||¬«}||_|S)N)r;r>Úownerr@)rÚ _wrap_bioÚ_sslobj) rrFrGr;r>r@r?r0rZs r/rBzSSLObject._create$sD€ð�{‰{˜3ÓˆØ×"Ñ"Ø �h¨KØ+Ø ð#ó
ˆð
ˆŒ ؈ r1có.—|jjS)z(The SSLContext that is currently in use.©rÄr?r�s r/r?zSSLObject.context0ó€ð�|‰|×#Ñ#Ð#r1có&—||j_yrYrÆ©r0Úctxs r/r?zSSLObject.context5s€à"ˆ� ‰ Õr1có.—|jjS)z!The SSLSession for client socket.©rÄr@r�s r/r@zSSLObject.session9rÇr1có&—||j_yrYrÌ©r0r@s r/r@zSSLObject.session>s€à&ˆ� ‰ Õr1có.—|jjS)z.Was the client session reused during handshake©rÄÚsession_reusedr�s r/rÑzSSLObject.session_reusedBs€ð�|‰|×*Ñ*Ð*r1có.—|jjS)z%Whether this is a server-side socket.)rÄr;r�s r/r;zSSLObject.server_sideGs€ð�|‰|×'Ñ'Ð'r1có.—|jjS)z^The currently set server hostname (for SNI), or ``None`` if no
server hostname is set.)rÄr>r�s r/r>zSSLObject.server_hostnameLs€ð�|‰|×+Ñ+Ð+r1có|—|�|jj||«}|S|jj|«}|S)z©Read up to 'len' bytes from the SSL object and return them.
If 'buffer' is provided, read into this buffer and return the number of
bytes read.
)rÄÚread)r0rOÚbufferÚvs r/rÕzSSLObject.readRsB€ð Ð Ø— ‘ ×!Ñ! # vÓ.ˆAðˆð— ‘ ×!Ñ! #Ó&ˆA؈r1có8—|jj|«S)z—Write 'data' to the SSL object and return the number of bytes
written.
The 'data' argument must support the buffer interface.
)rÄÚwrite©r0rœs r/rÙzSSLObject.write^s€ð �|‰|×!Ñ! $Ó'Ð'r1có8—|jj|«S)zëReturns a formatted version of the data in the certificate provided
by the other end of the SSL channel.
Return None if no certificate was provided, {} if a certificate was
provided, but not validated.
)rÄÚ getpeercert©r0Ú binary_forms r/rÜzSSLObject.getpeercertfs€ð�|‰|×'Ñ'¨ Ó4Ð4r1có<—tjdtd¬«y)z©Return the currently selected NPN protocol as a string, or ``None``
if a next protocol was not negotiated or if NPN is not supported by one
of the peers.rJr¬rKN)r)r*r+r�s r/Úselected_npn_protocolzSSLObject.selected_npn_protocolos€ô �
‰
Ø 5Ü Øö
r1có6—|jj«S)z«Return the currently selected ALPN protocol as a string, or ``None``
if a next protocol was not negotiated or if ALPN is not supported by one
of the peers.)rÄÚselected_alpn_protocolr�s r/râz SSLObject.selected_alpn_protocolys€ð�|‰|×2Ñ2Ó4Ð4r1có6—|jj«S)z_Return the currently selected cipher as a 3-tuple ``(name,
ssl_version, secret_bits)``.)rÄÚcipherr�s r/räzSSLObject.ciphers€ð�|‰|×"Ñ"Ó$Ð$r1có6—|jj«S)z…Return a list of ciphers shared by the client during the handshake or
None if this is not a valid server connection.
)rÄÚshared_ciphersr�s r/ræzSSLObject.shared_ciphers„s€ð�|‰|×*Ñ*Ó,Ð,r1có6—|jj«S)zŒReturn the current compression algorithm in use, or ``None`` if
compression was not negotiated or not supported by one of the peers.)rÄÚ compressionr�s r/rèzSSLObject.compressionŠs€ð�|‰|×'Ñ'Ó)Ð)r1có6—|jj«S)z8Return the number of bytes that can be read immediately.)rÄÚpendingr�s r/rêzSSLObject.pending�s€à�|‰|×#Ñ#Ó%Ð%r1có8—|jj«y)zStart the SSL/TLS handshake.N)rÄÚ do_handshaker�s r/rìzSSLObject.do_handshake“s€à � ‰ ×!Ñ!Õ#r1có6—|jj«S)z!Start the SSL shutdown handshake.)rÄÚshutdownr�s r/ÚunwrapzSSLObject.unwrap—s€à�|‰|×$Ñ$Ó&Ð&r1có8—|jj|«S)zÛGet channel binding data for current connection. Raise ValueError
if the requested `cb_type` is not supported. Return bytes of the data
or None if the data is not available (e.g. before the handshake).)rÄÚget_channel_binding©r0Úcb_types r/rñzSSLObject.get_channel_binding›s€ð�|‰|×/Ñ/°Ó8Ð8r1có6—|jj«S)zZReturn a string identifying the protocol version used by the
current SSL channel. ©rÄr™r�s r/r™zSSLObject.version¡s€ð�|‰|×#Ñ#Ó%Ð%r1có6—|jj«SrY)rÄÚverify_client_post_handshaker�s r/r÷z&SSLObject.verify_client_post_handshake¦s€Ø�|‰|×8Ñ8Ó:Ð:r1)FNNN©éN©F©rÙ)rErFrGr`rÀrrBr§r?r¨r@rÑr;r>rÕrÙrÜràrârärærèrêrìrïrñr™r÷rWr1r/r¼r¼s„ñ
ò
ð Ø5:Ø=Aò óð ðñ$óð$ð
‡^�^ñ#óð#ðñ$óð$ð
‡^�^ñ'óð'ðñ+óð+ðñ(óð(ðñ,óð,ó
ò(ó5ò
ò5ò %ò
-ò *ò
&ò$ò'ó9ò &ó
;r1r¼cóX—tt|j«j|_|S)z*Copy docstring from SSLObject to SSLSocket)Úgetattrr¼rEr`)Úfuncs r/Ú _sslcopydocrÿªs€äœ9 d§m¡mÓ4×<Ñ<€D„LØ €Kr1có^‡—eZdZdZd„Ze d+ˆfd„ «Zeed„««Z e jd„«Z eed„««Z e jd„«Z eed„««Z d „Z
d,d
„Zd „Zd-d „Zd
„Zed.d„«Zed„«Zed„«Zed„«Zed„«Zed„«Zd/ˆfd„ Zd,ˆfd„ Zd„Zd/ˆfd„ Zd0ˆfd„ Zd1ˆfd„ Zd2ˆfd„ Zd1ˆfd„ Zd2ˆfd„ Z d„Z!d„Z"ed„«Z#ˆfd „Z$ed!„«Z%ed"„«Z&ˆfd#„Z'ed.d$„«Z(ˆfd%„Z)d&„Z*d'„Z+ˆfd(„Z,ed3d)„«Z-ed*„«Z.ˆxZ/S)4Ú SSLSocketz¶This class implements a subtype of socket.socket that wraps
the underlying OS socket in an SSL context when necessary, and
provides read and write methods over that channel. cóF—t|jj›d�«‚)NzX does not have a public constructor. Instances are returned by SSLContext.wrap_socket().r¾r¿s r/rÀzSSLSocket.__init__µs)€ÜØ�~‰~×&Ñ&Ð'ð((ð
)ó
ð
r1c󾕗|jtt«tk7r t d«‚|r|r t d«‚|� t d«‚|j r
|s t d«‚|j«}t|j|j|j|j«¬«} |j|fi| ¤Ž}
tt|
�Bdi| ¤Ž|j#« ||
_||
_d|
_d|