ó
    _9jC» ã                  ó^  • % S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
  S SKJrJr  S SKJrJr  S SKJr  S SKJrJrJrJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr   S SKJ!r"  S SKJ#r$  S SKJ%r&  S SKJ'r(  S SKJ)r*  S SKJ+r,  S SK-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5  / SQr6\$Rn                  r7S\8S'   \$Rr                  r9S\8S'   \$Rt                  r:S\8S'   \$Rv                  r;S\8S'   \$Rx                  r<S\8S'   \$Rz                  r=S\8S'   \9r>\:r?\;r@\<rA\=rB\$R†                  rD\$RŠ                  rFSrGSrHSrIS rJS!rKS"rLS#rMS$rNS%rOS&rP\$R¢                  rQS\8S''   \$R¤                  rRS\8S('   \$R¦                  rSS\8S)'   \$R¨                  rTS\8S*'   \$Rª                  rUS\8S+'   \$R¬                  rWS\8S,'   \$R°                  rYS\8S-'   \$R´                  r[S\8S.'   \$R¸                  r]S\8S/'   \$R¼                  r_S\8S0'   \$RÀ                  raS\8S1'   \$RÄ                  rcS\8S2'   \$RÈ                  reS\8S3'   \$RÌ                  rgS\8S4'   \$RÐ                  riS\8S5'   \$RÔ                  rkS\8S6'   \$RØ                  rmS\8S7'   \$RÜ                  roS\8S8'   \$Rà                  rqS\8S9'   \$Rä                  rsS\8S:'   \$Rè                  ruS\8S;'   \$Rì                  rwS\8S<'   \$Rð                  ryS\8S='   \$Rô                  r{S\8S>'   \$Rø                  r}S\8S?'   \$Rü                  rS\8S@'   \$GR                   r�S\8SA'   \$GR                  rƒ\$GR                  r…S\8SB'   \$GR                  r‡S\8SC'   \$GR                  r‰S\8SD'   \$GR                  r‹S\8SE'   \$GR                  r�S\8SF'   \$GR                  r�S\8SG'   \$GR                   r‘S\8SH'    \$GR$                  r“S\8SI'   \6GR)                  SI5         \$GR,                  r—S\8SJ'   \6GR)                  SJ5         \$GR0                  r™S\8SK'   \6GR)                  SK5        \$GR4                  r›S\8SL'   \$GR8                  r�S\8SM'   \$GR<                  rŸS\8SN'   \$GR@                  r¡S\8SO'   \$GRD                  r£S\8SP'   \$GRH                  r¥S\8SQ'   \$GRL                  r§S\8SR'   \$GRP                  r©S\8SS'   \$GRT                  r«S\8ST'   \$GRX                  r­S\8SU'   \$GR\                  r¯S\8SV'   \$GR`                  r±S\8SW'   \$GRd                  r³S\8SX'   \$GRh                  r´S\8SY'   \$GRj                  rµS\8SZ'   \$GRl                  r¶S\8S['   \$GRn                  r·S\8S\'   \$GRp                  r¸S\8S]'   \$GRr                  r¹S\8S^'   \$GRt                  rºS\8S_'   \$GRv                  r»S\8S`'   \$GRx                  r¼S\8Sa'   \$GRz                  r½S\8Sb'   \$GR|                  r¾S\8Sc'   \$GR~                  r¿S\8Sd'   \$GR€                  rÀS\8Se'   \$GR‚                  rÁS\8Sf'   \$GR„                  rÂS\8Sg'   \$GR†                  rÃS\8Sh'   \" Si5      rÄ " Sj Sk5      rÅ\Å" 5       rÆ\Sl\GRŽ                  \È   /\GR’                  \È\Å4   4   rÊ\Sl/\È4   rË\Sl\È/\Ì4   rÍ\Sl\È\\Ä   /\Ì4   rÎ\Sl\\Ä   /\È4   rÏ\\Ð\Ì\\Ä   /\È4   rÑ\Sl\/\Ð\Ð\Ð/\Ì4   rÒ " Sm Sn5      rÓ/ SoQrÔSp/rÕSqrÖSrr× " Ss St\Ø5      rÙ\" \ \Ù5      rÚ\&" \Ù5      rÛ " Su Sv\Ù5      rÜ " Sw Sx\Ù5      rÝ " Sy Sz\Ù5      rÞ " S{ S|\Ù5      rß " S} S~\Ù5      rà " S S€5      rá " S� S‚\á5      râ " Sƒ S„\á5      rã " S… S†\á5      rä " S‡ Sˆ\á5      rå " S‰ SŠ\á5      ræ " S‹ SŒ\á5      rçS—S� jrèS˜SŽ jré\érêS™S� jrë\ë" \ì" \$S�S 5      S‘5      rí " S’ S“5      rî " S” S•5      rï " S– Sl5      rðg! \• a     GNÕf = f! \• a     GN½f = f! \• a     GN¥f = f)šé    )ÚannotationsN)ÚSequence)Ú	errorcode)ÚpartialÚwraps)ÚchainÚcount)Úplatform)ÚAnyÚCallableÚOptionalÚTypeVar)ÚWeakValueDictionary)Úx509)Úec)ÚStrOrBytesPath)Úexception_from_error_queue)Úffi)Úlib)Úmake_assert)Úno_zero_allocator)Ú
path_bytes)Útext_to_bytes_and_warn)ÚFILETYPE_PEMÚX509ÚPKeyÚX509NameÚ	X509StoreÚ_EllipticCurveÚ_PassphraseHelperÚ_PrivateKey)cÚDTLS_CLIENT_METHODÚDTLS_METHODÚDTLS_SERVER_METHODÚMODE_RELEASE_BUFFERSÚNO_OVERLAPPING_PROTOCOLSÚOPENSSL_BUILT_ONÚOPENSSL_CFLAGSÚOPENSSL_DIRÚOPENSSL_PLATFORMÚOPENSSL_VERSIONÚOPENSSL_VERSION_NUMBERÚOP_ALLÚOP_CIPHER_SERVER_PREFERENCEÚOP_COOKIE_EXCHANGEÚOP_DONT_INSERT_EMPTY_FRAGMENTSÚOP_EPHEMERAL_RSAÚOP_MICROSOFT_BIG_SSLV3_BUFFERÚOP_MICROSOFT_SESS_ID_BUGÚOP_MSIE_SSLV2_RSA_PADDINGÚOP_NETSCAPE_CA_DN_BUGÚOP_NETSCAPE_CHALLENGE_BUGÚ"OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUGÚ#OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUGÚOP_NO_COMPRESSIONÚOP_NO_QUERY_MTUÚOP_NO_TICKETÚOP_PKCS1_CHECK_1ÚOP_PKCS1_CHECK_2ÚOP_SINGLE_DH_USEÚOP_SINGLE_ECDH_USEÚOP_SSLEAY_080_CLIENT_DH_BUGÚOP_SSLREF2_REUSE_CERT_TYPE_BUGÚOP_TLS_BLOCK_PADDING_BUGÚOP_TLS_D5_BUGÚOP_TLS_ROLLBACK_BUGÚRECEIVED_SHUTDOWNÚSENT_SHUTDOWNÚSESS_CACHE_BOTHÚSESS_CACHE_CLIENTÚSESS_CACHE_NO_AUTO_CLEARÚSESS_CACHE_NO_INTERNALÚSESS_CACHE_NO_INTERNAL_LOOKUPÚSESS_CACHE_NO_INTERNAL_STOREÚSESS_CACHE_OFFÚSESS_CACHE_SERVERÚSSL3_VERSIONÚSSLEAY_BUILT_ONÚSSLEAY_CFLAGSÚ
SSLEAY_DIRÚSSLEAY_PLATFORMÚSSLEAY_VERSIONÚSSL_CB_ACCEPT_EXITÚSSL_CB_ACCEPT_LOOPÚSSL_CB_ALERTÚSSL_CB_CONNECT_EXITÚSSL_CB_CONNECT_LOOPÚSSL_CB_EXITÚSSL_CB_HANDSHAKE_DONEÚSSL_CB_HANDSHAKE_STARTÚSSL_CB_LOOPÚSSL_CB_READÚSSL_CB_READ_ALERTÚSSL_CB_WRITEÚSSL_CB_WRITE_ALERTÚSSL_ST_ACCEPTÚSSL_ST_CONNECTÚSSL_ST_MASKÚTLS1_1_VERSIONÚTLS1_2_VERSIONÚTLS1_3_VERSIONÚTLS1_VERSIONÚTLS_CLIENT_METHODÚ
TLS_METHODÚTLS_SERVER_METHODÚVERIFY_CLIENT_ONCEÚVERIFY_FAIL_IF_NO_PEER_CERTÚVERIFY_NONEÚVERIFY_PEERÚ
ConnectionÚContextÚErrorÚOP_NO_SSLv2ÚOP_NO_SSLv3ÚOP_NO_TLSv1ÚOP_NO_TLSv1_1ÚOP_NO_TLSv1_2ÚOP_NO_TLSv1_3ÚSSLeay_versionÚSSLv23_METHODÚSessionÚSysCallErrorÚTLSv1_1_METHODÚTLSv1_2_METHODÚTLSv1_METHODÚWantReadErrorÚWantWriteErrorÚWantX509LookupErrorÚX509VerificationCodesÚZeroReturnErrorÚintr,   r+   r(   r*   r)   r'   é   é   é   é   é   é   é	   é
   é   é   rO   rh   re   rf   rg   rs   rt   ru   rv   rw   rx   r%   r>   r?   r1   r3   r6   r8   rA   r2   r4   r@   rC   rB   r0   r.   rD   r=   r5   r7   r9   r:   r/   r;   ÚOP_NO_RENEGOTIATIONÚOP_IGNORE_UNEXPECTED_EOFÚOP_LEGACY_SERVER_CONNECTr-   ro   rm   rl   rn   rM   rH   rN   rG   rI   rK   rL   rJ   rc   rb   rd   r]   rZ   r^   r`   rW   r_   ra   rV   rU   rY   rX   r\   r[   Ú_Tc                  ó   • \ rS rSrSrg)Ú_NoOverlappingProtocolsi  © N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r–   ó    Ú-/usr/lib/python3/dist-packages/OpenSSL/SSL.pyr•   r•     ó   † Úr�   r•   rp   c                  óp  • \ rS rSrSr\R                  r\R                  r	\R                  r\R                  r\R                  r\R                   r\R$                  r\R(                  r\R,                  r\R0                  r\R4                  r\R8                  r\R<                  r\R@                  r!\RD                  r#\RH                  r%\RL                  r'\RP                  r)\RT                  r+\RX                  r-\R\                  r/\R`                  r1\Rd                  r3\Rh                  r5\Rl                  r7\Rp                  r9\Rt                  r;\Rx                  r=\R|                  r?\R€                  rA\R„                  rC\Rˆ                  rE\RŒ                  rG\R�                  rI\R”                  rK\R˜                  rM\Rœ                  rO\R                   rQ\R¤                  rS\R¨                  rU\R¬                  rW\R°                  rY\R´                  r[\R¸                  r]\R¼                  r_\RÀ                  ra\RÄ                  rc\RÈ                  re\RÌ                  rg\RÐ                  ri\RÔ                  rk\RØ                  rm\RÜ                  ro\Rà                  rq\Rä                  rs\Rè                  ru\Rì                  rwSrxg)rƒ   i1  a@  
Success and error codes for X509 verification, as returned by the
underlying ``X509_STORE_CTX_get_error()`` function and passed by pyOpenSSL
to verification callback functions.

See `OpenSSL Verification Errors
<https://www.openssl.org/docs/manmaster/man3/X509_verify_cert_error_string.html#ERROR-CODES>`_
for details.
r–   N)yr˜   r™   rš   r›   Ú__doc__Ú_libÚ	X509_V_OKÚOKÚ$X509_V_ERR_UNABLE_TO_GET_ISSUER_CERTÚERR_UNABLE_TO_GET_ISSUER_CERTÚX509_V_ERR_UNABLE_TO_GET_CRLÚERR_UNABLE_TO_GET_CRLÚ+X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATUREÚ$ERR_UNABLE_TO_DECRYPT_CERT_SIGNATUREÚ*X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATUREÚ#ERR_UNABLE_TO_DECRYPT_CRL_SIGNATUREÚ-X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEYÚ&ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEYÚ!X509_V_ERR_CERT_SIGNATURE_FAILUREÚERR_CERT_SIGNATURE_FAILUREÚ X509_V_ERR_CRL_SIGNATURE_FAILUREÚERR_CRL_SIGNATURE_FAILUREÚX509_V_ERR_CERT_NOT_YET_VALIDÚERR_CERT_NOT_YET_VALIDÚX509_V_ERR_CERT_HAS_EXPIREDÚERR_CERT_HAS_EXPIREDÚX509_V_ERR_CRL_NOT_YET_VALIDÚERR_CRL_NOT_YET_VALIDÚX509_V_ERR_CRL_HAS_EXPIREDÚERR_CRL_HAS_EXPIREDÚ)X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELDÚ"ERR_ERROR_IN_CERT_NOT_BEFORE_FIELDÚ(X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELDÚ!ERR_ERROR_IN_CERT_NOT_AFTER_FIELDÚ)X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELDÚ"ERR_ERROR_IN_CRL_LAST_UPDATE_FIELDÚ)X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELDÚ"ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELDÚX509_V_ERR_OUT_OF_MEMÚERR_OUT_OF_MEMÚ&X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERTÚERR_DEPTH_ZERO_SELF_SIGNED_CERTÚ$X509_V_ERR_SELF_SIGNED_CERT_IN_CHAINÚERR_SELF_SIGNED_CERT_IN_CHAINÚ,X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLYÚ%ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLYÚ*X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATUREÚ#ERR_UNABLE_TO_VERIFY_LEAF_SIGNATUREÚX509_V_ERR_CERT_CHAIN_TOO_LONGÚERR_CERT_CHAIN_TOO_LONGÚX509_V_ERR_CERT_REVOKEDÚERR_CERT_REVOKEDÚX509_V_ERR_INVALID_CAÚERR_INVALID_CAÚX509_V_ERR_PATH_LENGTH_EXCEEDEDÚERR_PATH_LENGTH_EXCEEDEDÚX509_V_ERR_INVALID_PURPOSEÚERR_INVALID_PURPOSEÚX509_V_ERR_CERT_UNTRUSTEDÚERR_CERT_UNTRUSTEDÚX509_V_ERR_CERT_REJECTEDÚERR_CERT_REJECTEDÚ"X509_V_ERR_SUBJECT_ISSUER_MISMATCHÚERR_SUBJECT_ISSUER_MISMATCHÚX509_V_ERR_AKID_SKID_MISMATCHÚERR_AKID_SKID_MISMATCHÚ&X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCHÚERR_AKID_ISSUER_SERIAL_MISMATCHÚX509_V_ERR_KEYUSAGE_NO_CERTSIGNÚERR_KEYUSAGE_NO_CERTSIGNÚ#X509_V_ERR_UNABLE_TO_GET_CRL_ISSUERÚERR_UNABLE_TO_GET_CRL_ISSUERÚ'X509_V_ERR_UNHANDLED_CRITICAL_EXTENSIONÚ ERR_UNHANDLED_CRITICAL_EXTENSIONÚX509_V_ERR_KEYUSAGE_NO_CRL_SIGNÚERR_KEYUSAGE_NO_CRL_SIGNÚ+X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSIONÚ$ERR_UNHANDLED_CRITICAL_CRL_EXTENSIONÚX509_V_ERR_INVALID_NON_CAÚERR_INVALID_NON_CAÚ%X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDEDÚERR_PROXY_PATH_LENGTH_EXCEEDEDÚ(X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATUREÚ!ERR_KEYUSAGE_NO_DIGITAL_SIGNATUREÚ)X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWEDÚ"ERR_PROXY_CERTIFICATES_NOT_ALLOWEDÚX509_V_ERR_INVALID_EXTENSIONÚERR_INVALID_EXTENSIONÚ#X509_V_ERR_INVALID_POLICY_EXTENSIONÚERR_INVALID_POLICY_EXTENSIONÚX509_V_ERR_NO_EXPLICIT_POLICYÚERR_NO_EXPLICIT_POLICYÚX509_V_ERR_DIFFERENT_CRL_SCOPEÚERR_DIFFERENT_CRL_SCOPEÚ(X509_V_ERR_UNSUPPORTED_EXTENSION_FEATUREÚ!ERR_UNSUPPORTED_EXTENSION_FEATUREÚX509_V_ERR_UNNESTED_RESOURCEÚERR_UNNESTED_RESOURCEÚX509_V_ERR_PERMITTED_VIOLATIONÚERR_PERMITTED_VIOLATIONÚX509_V_ERR_EXCLUDED_VIOLATIONÚERR_EXCLUDED_VIOLATIONÚX509_V_ERR_SUBTREE_MINMAXÚERR_SUBTREE_MINMAXÚ&X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPEÚERR_UNSUPPORTED_CONSTRAINT_TYPEÚ(X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAXÚ!ERR_UNSUPPORTED_CONSTRAINT_SYNTAXÚ"X509_V_ERR_UNSUPPORTED_NAME_SYNTAXÚERR_UNSUPPORTED_NAME_SYNTAXÚ$X509_V_ERR_CRL_PATH_VALIDATION_ERRORÚERR_CRL_PATH_VALIDATION_ERRORÚX509_V_ERR_HOSTNAME_MISMATCHÚERR_HOSTNAME_MISMATCHÚX509_V_ERR_EMAIL_MISMATCHÚERR_EMAIL_MISMATCHÚX509_V_ERR_IP_ADDRESS_MISMATCHÚERR_IP_ADDRESS_MISMATCHÚ#X509_V_ERR_APPLICATION_VERIFICATIONÚERR_APPLICATION_VERIFICATIONrœ   r–   r�   rž   rƒ   rƒ   1  sø  † ñð 
�‰€BØ$(×$MÑ$MÐ!Ø ×=Ñ=Ðà×8Ñ8ð )ð 	×7Ñ7ð (ð 	×:Ñ:ð +ð "&×!GÑ!GÐØ $× EÑ EÐØ!×?Ñ?ÐØ×;Ñ;ÐØ ×=Ñ=ÐØ×9Ñ9Ðà×6Ñ6ð 'ð 	×5Ñ5ð &ð 	×6Ñ6ð 'ð 	×6Ñ6ð 'ð ×/Ñ/€Nà×3Ñ3ð $ð %)×$MÑ$MÐ!à×9Ñ9ð *ð 	×7Ñ7ð (ð #×AÑAÐØ×3Ñ3ÐØ×/Ñ/€NØ#×CÑCÐØ×9Ñ9ÐØ×7Ñ7ÐØ×5Ñ5ÐØ"&×"IÑ"IÐØ!×?Ñ?Ðà×3Ñ3ð $ð  $×CÑCÐØ#'×#KÑ#KÐ à×4Ñ4ð %ð  $×CÑCÐà×8Ñ8ð )ð ×7Ñ7ÐØ%)×%OÑ%OÐ"à×5Ñ5ð &ð 	×6Ñ6ð 'ð !×=Ñ=ÐØ#'×#KÑ#KÐ Ø!×?Ñ?ÐØ"×AÑAÐà×5Ñ5ð &ð !×=Ñ=ÐØ"×AÑAÐØ!×?Ñ?ÐØ×7Ñ7Ðà×3Ñ3ð $ð 	×5Ñ5ð &ð #'×"IÑ"IÐØ$(×$MÑ$MÐ!Ø ×=Ñ=ÐØ×7Ñ7ÐØ"×AÑAÐØ#'×#KÑ#KÓ r�   rƒ   )z"/etc/ssl/certs/ca-certificates.crtz /etc/pki/tls/certs/ca-bundle.crtz/etc/ssl/ca-bundle.pemz/etc/pki/tls/cacert.pemz1/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pemz/etc/ssl/certss$   /opt/pyca/cryptography/openssl/certss'   /opt/pyca/cryptography/openssl/cert.pemc                  ó   • \ rS rSrSrSrg)rr   i®  z,
An error occurred in an `OpenSSL.SSL` API.
r–   N)r˜   r™   rš   r›   r¡   rœ   r–   r�   rž   rr   rr   ®  s   † ôr�   rr   c                  ó   • \ rS rSrSrg)r€   i¸  r–   Nr—   r–   r�   rž   r€   r€   ¸  rŸ   r�   r€   c                  ó   • \ rS rSrSrg)r�   i¼  r–   Nr—   r–   r�   rž   r�   r�   ¼  rŸ   r�   r�   c                  ó   • \ rS rSrSrg)r‚   iÀ  r–   Nr—   r–   r�   rž   r‚   r‚   À  rŸ   r�   r‚   c                  ó   • \ rS rSrSrg)r„   iÄ  r–   Nr—   r–   r�   rž   r„   r„   Ä  rŸ   r�   r„   c                  ó   • \ rS rSrSrg)r|   iÈ  r–   Nr—   r–   r�   rž   r|   r|   È  rŸ   r�   r|   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)Ú_CallbackExceptionHelperiÌ  a¥  
A base class for wrapper classes that allow for intelligent exception
handling in OpenSSL callbacks.

:ivar list _problems: Any exceptions that occurred while executing in a
    context where they could not be raised in the normal way.  Typically
    this is because OpenSSL has called into some Python code and requires a
    return value.  The exceptions are saved to be raised later when it is
    possible to do so.
c                ó   • / U l         g ©N©Ú	_problems©Úselfs    rž   Ú__init__Ú!_CallbackExceptionHelper.__init__Ø  s	   € Ø*,ˆ�r�   c                ó’   • U R                   (       a&   [        5         U R                   R                  S5      eg! [         a     N(f = f)zi
Raise an exception from the OpenSSL error queue or that was previously
captured whe running a callback.
r   N)r   Ú_raise_current_errorrr   Úpopr!  s    rž   Úraise_if_problemÚ)_CallbackExceptionHelper.raise_if_problemÛ  sF   € ð
 �>�>ðÜ$Ô&ð —.‘.×$Ñ$ QÓ'Ð'ð øô ó Ùðús   “
9 ¹
AÁAr  N©ÚreturnÚNone)r˜   r™   rš   r›   r¡   r#  r(  rœ   r–   r�   rž   r  r  Ì  s   † ñ	ô-÷
(r�   r  c                  ó"   • \ rS rSrSrSS jrSrg)Ú_VerifyHelperiè  zR
Wrap a callback such that it can be used as a certificate verification
callback.
c                ó”   ^ ^• [         R                  T 5        [        T5      UU 4S j5       n[        R                  " SU5      T l        g )Nc                ó2  >• [         R                  " U5      n[         R                  " U5        [        R                  " U5      n[         R
                  " U5      n[         R                  " U5      n[         R                  " 5       n[         R                  " X5      n[        R                  U   n T" XƒXEU 5      n	U	(       a&  [         R                  " U[         R                  5        gg! [         a%  n
TR                  R                  U
5         S n
A
gS n
A
ff = f)Né   r   )r¢   ÚX509_STORE_CTX_get_current_certÚX509_up_refr   Ú_from_raw_x509_ptrÚX509_STORE_CTX_get_errorÚX509_STORE_CTX_get_error_depthÚ"SSL_get_ex_data_X509_STORE_CTX_idxÚX509_STORE_CTX_get_ex_datarp   Ú_reverse_mappingÚX509_STORE_CTX_set_errorr£   Ú	Exceptionr   Úappend)ÚokÚ	store_ctxr   ÚcertÚerror_numberÚerror_depthÚindexÚsslÚ
connectionÚresultÚeÚcallbackr"  s              €€rž   ÚwrapperÚ'_VerifyHelper.__init__.<locals>.wrapperñ  sÛ   ø€ ä×7Ò7¸	ÓBˆDÜ×Ò˜TÔ"Ü×*Ò*¨4Ó0ˆDÜ×8Ò8¸ÓCˆLÜ×=Ò=¸iÓHˆKä×;Ò;Ó=ˆEÜ×1Ò1°)ÓCˆCÜ#×4Ñ4°SÑ9ˆJðÙ!Ø lÀó�ö Ü×1Ò1°)¼T¿^¹^ÔLØàøô ó Ø—‘×%Ñ% aÔ(Üûðús   Â/
C' Ã'
DÃ1DÄDzint (*)(int, X509_STORE_CTX *)©r  r#  r   Ú_ffirG  ©r"  rG  rH  s   `` rž   r#  Ú_VerifyHelper.__init__î  s>   ù€ Ü ×)Ñ)¨$Ô/ä	ˆx‹õ	ó 
ð	ô2 ŸšØ,¨gó
ˆ�r�   ©rG  N)rG  Ú_VerifyCallbackr+  r,  ©r˜   r™   rš   r›   r¡   r#  rœ   r–   r�   rž   r.  r.  è  s   † ñ÷

r�   r.  c                  ó"   • \ rS rSrSrSS jrSrg)Ú_ALPNSelectHelperi  zI
Wrap a callback such that it can be used as an ALPN selection callback.
c                ó”   ^ ^• [         R                  T 5        [        T5      UU 4S j5       n[        R                  " SU5      T l        g )Nc                óÔ  >•  [         R                  U    n[        R                  " X45      S S  n/ nU(       a.  US   n	USU	S-    n
UR	                  U
5        XyS-   S  nU(       a  M.  T" Xh5      nSnU[
        L a  SnSnO [        U[        5      (       d  [        S5      e[        R                  " S[        U5      5      [        R                  " SU5      /Ul        UR                  S   S   US'   UR                  S   US'   U(       d  [        R                  $ [        R                  $ ! [         a5  nTR                   R	                  U5        [        R"                  s S nA$ S nAff = f)	Nr   r1  Tr�   Fz^ALPN callback must return a bytestring or the special NO_OVERLAPPING_PROTOCOLS sentinel value.zunsigned char *úunsigned char[])rp   r9  rK  Úbufferr<  r&   Ú
isinstanceÚbytesÚ	TypeErrorÚnewÚlenÚ_alpn_select_callback_argsr¢   ÚSSL_TLSEXT_ERR_NOACKÚSSL_TLSEXT_ERR_OKr;  r   ÚSSL_TLSEXT_ERR_ALERT_FATAL)rC  ÚoutÚoutlenÚin_ÚinlenÚargÚconnÚinstrÚ	protolistÚencoded_lenÚprotoÚoutbytesÚany_acceptedrF  rG  r"  s                 €€rž   rH  Ú+_ALPNSelectHelper.__init__.<locals>.wrapper  s\  ø€ ð(7Ü!×2Ñ2°3Ñ7�ô
 Ÿš CÓ/±Ð2�Ø�	ÞØ"'¨¡(�KØ! ! k°A¡oÐ6�EØ×$Ñ$ UÔ+Ø!°¡/Ð"3Ð4�E÷	 �eñ $ DÓ4�Ø#�ØÔ7Ò7Ø"�HØ#(‘LÜ# H¬e×4Ñ4Ü#ðKóð ô —H’HÐ.´°H³Ó>Ü—H’HÐ.°Ó9ð3�Ô/ð !×;Ñ;¸AÑ>¸qÑA��q‘	Ø×8Ñ8¸Ñ;��A‘Þ#Ü×4Ñ4Ð4Ü×-Ñ-Ð-øÜó 7Ø—‘×%Ñ% aÔ(Ü×6Ñ6Õ6ûð7ús+   ƒA!D( Á&B1D( ÄD( Ä(
E'Ä2*E"ÅE'Å"E'z^int (*)(SSL *, unsigned char **, unsigned char *, const unsigned char *, unsigned int, void *)rJ  rL  s   `` rž   r#  Ú_ALPNSelectHelper.__init__  sD   ù€ Ü ×)Ñ)¨$Ô/ä	ˆx‹õ)	7ó 
ð)	7ôV Ÿšð?ð ó
ˆ�r�   rN  N©rG  Ú_ALPNSelectCallbackr+  r,  rP  r–   r�   rž   rR  rR    s   † ñ÷5
r�   rR  c                  ó"   • \ rS rSrSrSS jrSrg)Ú_OCSPServerCallbackHelperiM  a°  
Wrap a callback such that it can be used as an OCSP callback for the server
side.

Annoyingly, OpenSSL defines one OCSP callback but uses it in two different
ways. For servers, that callback is expected to retrieve some OCSP data and
hand it to OpenSSL, and may return only SSL_TLSEXT_ERR_OK,
SSL_TLSEXT_ERR_FATAL, and SSL_TLSEXT_ERR_NOACK. For clients, that callback
is expected to check the OCSP data, and returns a negative value on error,
0 if the response is not acceptable, or positive if it is. These are
mutually exclusive return code behaviours, and they mean that we need two
helpers so that we always return an appropriate error code if the user's
code throws an exception.

Given that we have to have two helpers anyway, these helpers are a bit more
helpery than most: specifically, they hide a few more of the OpenSSL
functions so that the user has an easier time writing these callbacks.

This helper implements the server side.
c                ó”   ^ ^• [         R                  T 5        [        T5      UU 4S j5       n[        R                  " SU5      T l        g )Nc                óî  >•  [         R                  U    nU[        R                  :w  a  [        R                  " U5      nOS nT" X#5      n[        U[        5      (       d  [        S5      eU(       d  g[        U5      n[        R                  " U5      nU[        R                  " Xe5      S S & [        R                  " XU5        g! [         a%  nT	R                  R                  U5         S nAgS nAff = f)Nz'OCSP callback must return a bytestring.r†   r   é   )rp   r9  rK  ÚNULLÚfrom_handlerW  rX  rY  r[  r¢   ÚOPENSSL_mallocrV  ÚSSL_set_tlsext_status_ocsp_respr;  r   r<  )
rC  Úcdatare  ÚdataÚ	ocsp_dataÚocsp_data_lengthÚdata_ptrrF  rG  r"  s
           €€rž   rH  Ú3_OCSPServerCallbackHelper.__init__.<locals>.wrapperf  sÖ   ø€ ð#Ü!×2Ñ2°3Ñ7�ð œDŸI™IÓ%Ü×+Ò+¨EÓ2‘Dà�Dñ % TÓ0�	ä! )¬U×3Ñ3Ü#Ð$MÓNÐNö !Øô $' y£>Ð Ü×.Ò.Ð/?Ó@�Ø=F”—’˜HÓ7¹Ð:ä×4Ò4ØÐ#3ôð øÜó Ø—‘×%Ñ% aÔ(Üûðús   ƒA/C Á3AC Ã
C4ÃC/Ã/C4úint (*)(SSL *, void *)rJ  rL  s   `` rž   r#  Ú"_OCSPServerCallbackHelper.__init__c  s=   ù€ Ü ×)Ñ)¨$Ô/ä	ˆx‹õ$	ó 
ð$	ôL ŸšÐ&>ÀÓHˆ�r�   rN  N)rG  z_OCSPServerCallback[Any]r+  r,  rP  r–   r�   rž   rq  rq  M  s   † ñ÷**Ir�   rq  c                  ó"   • \ rS rSrSrSS jrSrg)Ú_OCSPClientCallbackHelperi�  a°  
Wrap a callback such that it can be used as an OCSP callback for the client
side.

Annoyingly, OpenSSL defines one OCSP callback but uses it in two different
ways. For servers, that callback is expected to retrieve some OCSP data and
hand it to OpenSSL, and may return only SSL_TLSEXT_ERR_OK,
SSL_TLSEXT_ERR_FATAL, and SSL_TLSEXT_ERR_NOACK. For clients, that callback
is expected to check the OCSP data, and returns a negative value on error,
0 if the response is not acceptable, or positive if it is. These are
mutually exclusive return code behaviours, and they mean that we need two
helpers so that we always return an appropriate error code if the user's
code throws an exception.

Given that we have to have two helpers anyway, these helpers are a bit more
helpery than most: specifically, they hide a few more of the OpenSSL
functions so that the user has an easier time writing these callbacks.

This helper implements the client side.
c                ó”   ^ ^• [         R                  T 5        [        T5      UU 4S j5       n[        R                  " SU5      T l        g )Nc                óÈ  >•  [         R                  U    nU[        R                  :w  a  [        R                  " U5      nOS n[        R
                  " S5      n[        R                  " X5      nUS:  a  SnO[        R                  " US   U5      S S  nT	" X&U5      n[        [        U5      5      $ ! [         a%  nT
R                  R                  U5         S nAgS nAff = f)Núunsigned char **r   r�   éÿÿÿÿ)rp   r9  rK  ru  rv  rZ  r¢   ÚSSL_get_tlsext_status_ocsp_resprV  r…   Úboolr;  r   r<  )rC  ry  re  rz  Úocsp_ptrÚocsp_lenr{  ÚvalidrF  rG  r"  s            €€rž   rH  Ú3_OCSPClientCallbackHelper.__init__.<locals>.wrapper©  sÅ   ø€ ðÜ!×2Ñ2°3Ñ7�ð œDŸI™IÓ%Ü×+Ò+¨EÓ2‘Dà�Dô  Ÿ8š8Ð$6Ó7�Ü×?Ò?ÀÓN�Ø˜a“<à #‘Iô !%§¢¨H°Q©K¸Ó BÁ1Ð E�Iá  °$Ó7�ô œ4 ›;Ó'Ð'øäó Ø—‘×%Ñ% aÔ(äûðús   ƒB.B2 Â2
C!Â<CÃC!r  rJ  rL  s   `` rž   r#  Ú"_OCSPClientCallbackHelper.__init__¦  s<   ù€ Ü ×)Ñ)¨$Ô/ä	ˆx‹õ	ó 
ð	ô< ŸšÐ&>ÀÓHˆ�r�   rN  N)rG  z_OCSPClientCallback[Any]r+  r,  rP  r–   r�   rž   r‚  r‚  �  s   † ñ÷*"Ir�   r‚  c                  ó   • \ rS rSrSS jrSrg)Ú_CookieGenerateCallbackHelperiË  c                óº   ^ ^^• [         R                  T 5        [        [        SS5      m[	        T5      UUU 4S j5       n[
        R                  " SU5      T l        g )NÚDTLS1_COOKIE_LENGTHéÿ   c                ó,  >•  [         R                  U    nT" U5      n[        U5      T:”  a  [        S[        U5       ST S35      eXAS[        U5      & [        U5      US'   g! [         a%  nTR
                  R                  U5         S nAgS nAff = f)NzCookie too long (got z bytes, max Ú)r   r1  )rp   r9  r[  Ú
ValueErrorr;  r   r<  )	rC  r`  ra  re  ÚcookierF  rG  Úmax_cookie_lenr"  s	         €€€rž   rH  Ú7_CookieGenerateCallbackHelper.__init__.<locals>.wrapperÑ  sœ   ø€ ðÜ!×2Ñ2°3Ñ7�Ù! $›�Ü�v“; Ó/Ü$Ø/´°F³¨}ð =Ø-Ð.¨að1óð ð (.�Aœ˜F›Ð$Ü ›K��q‘	ØøÜó Ø—‘×%Ñ% aÔ(äûðús   ƒA A$ Á$
BÁ.BÂBz/int (*)(SSL *, unsigned char *, unsigned int *))r  r#  Úgetattrr¢   r   rK  rG  )r"  rG  rH  r—  s   `` @rž   r#  Ú&_CookieGenerateCallbackHelper.__init__Ì  sN   ú€ Ü ×)Ñ)¨$Ô/ä ¤Ð'<¸cÓBˆä	ˆx‹ö	ó 
ð	ô" ŸšØ=Øó
ˆ�r�   rN  N©rG  Ú_CookieGenerateCallbackr+  r,  ©r˜   r™   rš   r›   r#  rœ   r–   r�   rž   r�  r�  Ë  s   † ÷
r�   r�  c                  ó   • \ rS rSrSS jrSrg)Ú_CookieVerifyCallbackHelperié  c                ó”   ^ ^• [         R                  T 5        [        T5      UU 4S j5       n[        R                  " SU5      T l        g )Nc                óº   >•  [         R                  U    nT" U[        USU 5      5      $ ! [         a%  nTR                  R                  U5         S nAgS nAff = f©Nr   )rp   r9  rX  r;  r   r<  )rC  Úc_cookieÚ
cookie_lenre  rF  rG  r"  s        €€rž   rH  Ú5_CookieVerifyCallbackHelper.__init__.<locals>.wrapperí  sV   ø€ ðÜ!×2Ñ2°3Ñ7�Ù ¤e¨H°Q°zÐ,BÓ&CÓDÐDøÜó Ø—‘×%Ñ% aÔ(Üûðús   ƒ'+ «
AµAÁAz-int (*)(SSL *, unsigned char *, unsigned int)rJ  rL  s   `` rž   r#  Ú$_CookieVerifyCallbackHelper.__init__ê  s?   ù€ Ü ×)Ñ)¨$Ô/ä	ˆx‹õ	ó 
ð	ô ŸšØ;Øó
ˆ�r�   rN  N©rG  Ú_CookieVerifyCallbackr+  r,  r�  r–   r�   rž   rŸ  rŸ  é  s   † ÷
r�   rŸ  c                óü   • S n[        U [        5      (       d  [        U SS 5      nUb  U" 5       n [        U [        5      (       a  U n[        U[        5      (       d  [        S5      eUS:  a  [	        SUS S35      eU$ )NÚfilenoz3argument must be an int, or have a fileno() method.r   z.file descriptor cannot be a negative integer (Úir”  )rW  r…   r™  rY  r•  )ÚobjÚfdÚmeths      rž   Ú_asFileDescriptorr¯  ü  sƒ   € Ø	€BÜ�cœ3×ÑÜ�s˜H dÓ+ˆØÑÙ“&ˆCä�#”s×ÑØˆä�bœ#×ÑÜÐMÓNÐNØ	ˆa‹ÜØ<¸RÀ¸FÀ!ÐDó
ð 	
ð €Ir�   c                óV   • [         R                  " [        R                  " U 5      5      $ )zˆ
Return a string describing the version of OpenSSL in use.

:param type: One of the :const:`OPENSSL_` constants defined in this module.
)rK  Ústringr¢   ÚOpenSSL_version)Útypes    rž   r²  r²    s   € ô �;Š;”t×+Ò+¨DÓ1Ó2Ð2r�   c                ó   ^ ^• UU 4S jnU$ )ax  
Builds a decorator that ensures that functions that rely on OpenSSL
functions that are not present in this build raise NotImplementedError,
rather than AttributeError coming out of cryptography.

:param flag: A cryptography flag that guards the functions, e.g.
    ``Cryptography_HAS_NEXTPROTONEG``.
:param error: The string to be used in the exception if the flag is false.
c                óB   >• T(       d  [        U 5      U4S j5       nU$ U $ )Nc                 ó   >• [        T5      er  ©ÚNotImplementedError)ÚargsÚkwargsÚerrors     €rž   ÚexplodeÚ<_make_requires.<locals>._requires_decorator.<locals>.explode*  s   ø€ ä)¨%Ó0Ð0r�   )r   )Úfuncr¼  r»  Úflags     €€rž   Ú_requires_decoratorÚ+_make_requires.<locals>._requires_decorator'  s(   ø€ Þä�4‹[ô1ó ð1ð ˆNàˆKr�   r–   )r¿  r»  rÀ  s   `` rž   Ú_make_requiresrÂ    s   ù€ ö	ð Ðr�   ÚCryptography_HAS_KEYLOGzKey logging not availablec                  ó$   • \ rS rSr% SrS\S'   Srg)r{   i:  zµ
A class representing an SSL session.  A session defines certain connection
parameters which may be re-used to speed up the setup of subsequent
connections.

.. versionadded:: 0.14
r   Ú_sessionr–   N)r˜   r™   rš   r›   r¡   Ú__annotations__rœ   r–   r�   rž   r{   r{   :  s   ‡ ñð †Mr�   r{   c                  óò  • \ rS rSr% Sr\\R                  S4\\R                  \	4\
\R                  \4\\R                  \4\\R                  S4\\R                   S4\\R$                  S4\\R(                  S4\\R,                  S4\\R0                  S40
rS\S'   S7S jrS8S jrS8S jr S9     S:S	 jjr    S;S
 jr S9     S<S jjr S=S jr!S>S jr"      S?S jr#S@S jr$\%4     SAS jjr&SBS jr'SCS jr(S=S jr)\%4     SDS jjr*SES jr+S=S jr,SFS jr-SGS jr.SHS jr/SIS jr0 S9     SJS jjr1SKS jr2SIS jr3SIS jr4SLS jr5SMS  jr6SNS! jr7    SOS" jr8    SPS# jr9SQS$ jr:SIS% jr;    SRS& jr<\=    SSS' j5       r>STS( jr?SUS) jr@SVS* jrASWS+ jrBSHS, jrC    SXS- jrDSYS. jrESZS/ jrFS[S0 jrG      S\S1 jrH S9     S]S2 jjrI S9     S^S3 jjrJ    S_S4 jrK    S`S5 jrLS6rMg)arq   iF  aY  
:class:`OpenSSL.SSL.Context` instances define the parameters for setting
up new SSL connections.

:param method: One of TLS_METHOD, TLS_CLIENT_METHOD, TLS_SERVER_METHOD,
               DTLS_METHOD, DTLS_CLIENT_METHOD, or DTLS_SERVER_METHOD.
               SSLv23_METHOD, TLSv1_METHOD, etc. are deprecated and should
               not be used.
Nz@typing.ClassVar[dict[int, tuple[Callable[[], Any], int | None]]]Ú_methodsc                ó  • [        U[        5      (       d  [        S5      e U R                  U   u  p#U" 5       n[        U[        R                  :g  5        [        R                  " U5      n[        U[        R                  :g  5        [        R                  " U[        R                  5      nXPl        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        S U l        U R=                  [        R>                  5        Ub#  U RA                  U5        U RC                  U5        g g ! [         a    [        S5      ef = f)Nzmethod must be an integerzNo such protocol)"rW  r…   rY  rÈ  ÚKeyErrorr•  Ú_openssl_assertrK  ru  r¢   ÚSSL_CTX_newÚgcÚSSL_CTX_freeÚ_contextÚ_passphrase_helperÚ_passphrase_callbackÚ_passphrase_userdataÚ_verify_helperÚ_verify_callbackÚ_info_callbackÚ_keylog_callbackÚ_tlsext_servername_callbackÚ	_app_dataÚ_alpn_select_helperÚ_alpn_select_callbackÚ_ocsp_helperÚ_ocsp_callbackÚ
_ocsp_dataÚ_cookie_generate_helperÚ_cookie_verify_helperÚset_modeÚSSL_MODE_ENABLE_PARTIAL_WRITEÚset_min_proto_versionÚset_max_proto_version)r"  ÚmethodÚmethod_funcÚversionÚ
method_objÚcontexts         rž   r#  ÚContext.__init__`  so  € Ü˜&¤#×&Ñ&ÜÐ7Ó8Ð8ð	1Ø#'§=¡=°Ñ#8Ñ ˆKñ !“]ˆ
Ü˜
¤d§i¡iÑ/Ô0ä×"Ò" :Ó.ˆÜ˜¤4§9¡9Ñ,Ô-Ü—'’'˜'¤4×#4Ñ#4Ó5ˆàŒØ<@ˆÔØEIˆÔ!Ø04ˆÔ!Ø48ˆÔØ8<ˆÔØ"ˆÔØ $ˆÔØ+/ˆÔ(ØˆŒØ=AˆÔ ØAEˆÔ"ð ð 	Ôð
 ð 	Ôð '+ˆŒàð 	Ô$ð JNˆÔ"à�‰”d×8Ñ8Ô9ØÑØ×&Ñ& wÔ/Ø×&Ñ& wÕ/ð øôG ó 	1ÜÐ/Ó0Ð0ð	1ús   ¢E) Å)E?c                ó^   • [        [        R                  " U R                  U5      S:H  5        g)a  
Set the minimum supported protocol version. Setting the minimum
version to 0 will enable protocol versions down to the lowest version
supported by the library.

If the underlying OpenSSL build is missing support for the selected
version, this method will raise an exception.
r1  N)rË  r¢   ÚSSL_CTX_set_min_proto_versionrÏ  ©r"  ræ  s     rž   râ  ÚContext.set_min_proto_version�  ó%   € ô 	Ü×.Ò.¨t¯}©}¸gÓFÈ!ÑKõ	
r�   c                ó^   • [        [        R                  " U R                  U5      S:H  5        g)a  
Set the maximum supported protocol version. Setting the maximum
version to 0 will enable protocol versions up to the highest version
supported by the library.

If the underlying OpenSSL build is missing support for the selected
version, this method will raise an exception.
r1  N)rË  r¢   ÚSSL_CTX_set_max_proto_versionrÏ  rì  s     rž   rã  ÚContext.set_max_proto_versionš  rî  r�   c                óæ   • Uc  [         R                  nO[        U5      nUc  [         R                  nO[        U5      n[        R                  " U R
                  X5      nU(       d  [        5         gg)aõ  
Let SSL know where we can find trusted certificates for the certificate
chain.  Note that the certificates have to be in PEM format.

If capath is passed, it must be a directory prepared using the
``c_rehash`` tool included with OpenSSL.  Either, but not both, of
*pemfile* or *capath* may be :data:`None`.

:param cafile: In which file we can find the certificates (``bytes`` or
    ``str``).
:param capath: In which directory we can find the certificates
    (``bytes`` or ``str``).

:return: None
N)rK  ru  Ú_path_bytesr¢   ÚSSL_CTX_load_verify_locationsrÏ  r&  )r"  ÚcafileÚcapathÚload_results       rž   Úload_verify_locationsÚContext.load_verify_locations§  s]   € ð( ‰>Ü—Y‘Y‰Fä  Ó(ˆFà‰>Ü—Y‘Y‰Fä  Ó(ˆFä×8Ò8Ø�M‰M˜6ó
ˆö Ü Õ"ð r�   c                óT   ^ ^• [        T5      SUU 4S jj5       n[        [        USSS9$ )Nc                ó*   >• T" XTR                   5      $ r  )rÒ  )ÚsizeÚverifyÚuserdatarG  r"  s      €€rž   rH  Ú'Context._wrap_callback.<locals>.wrapperÎ  s   ø€ á˜D¨$×*CÑ*CÓDÐDr�   T)Ú	more_argsÚtruncate)rü  r…   rý  rˆ  rþ  r   r+  rX  )r   r    r   rL  s   `` rž   Ú_wrap_callbackÚContext._wrap_callbackË  s5   ù€ ô 
ˆx‹÷	Eó 
ð	Eô !Ü˜'¨T¸Dñ
ð 	
r�   c                óþ   • [        U5      (       d  [        S5      eU R                  U5      U l        U R                  R                  U l        [        R                  " U R                  U R
                  5        X l	        g)ar  
Set the passphrase callback.  This function will be called
when a private key with a passphrase is loaded.

:param callback: The Python callback to use.  This must accept three
    positional arguments.  First, an integer giving the maximum length
    of the passphrase it may return.  If the returned passphrase is
    longer than this, it will be truncated.  Second, a boolean value
    which will be true if the user should be prompted for the
    passphrase twice and the callback should verify that the two values
    supplied are equal. Third, the value given as the *userdata*
    parameter to :meth:`set_passwd_cb`.  The *callback* must return
    a byte string. If an error occurs, *callback* should return a false
    value (e.g. an empty string).
:param userdata: (optional) A Python object which will be given as
                 argument to the callback
:return: None
úcallback must be callableN)
ÚcallablerY  r  rÐ  rG  rÑ  r¢   ÚSSL_CTX_set_default_passwd_cbrÏ  rÒ  )r"  rG  rþ  s      rž   Úset_passwd_cbÚContext.set_passwd_cbÖ  sg   € ô. ˜×!Ñ!ÜÐ7Ó8Ð8à"&×"5Ñ"5°hÓ"?ˆÔØ$(×$;Ñ$;×$DÑ$DˆÔ!Ü×*Ò*Ø�M‰M˜4×4Ñ4ô	
ð %-Õ!r�   c                ór  • [         R                  " U R                  5      n[        US:H  5        [        R
                  " [         R                  " 5       5      R                  S5      n[        R
                  " [         R                  " 5       5      R                  S5      nU R                  X#5      (       dƒ  [        R
                  " [         R                  " 5       5      n[        R
                  " [         R                  " 5       5      nU[        :X  a&  U[        :X  a  U R                  [        [         5        gggg)aw  
Specify that the platform provided CA certificates are to be used for
verification purposes. This method has some caveats related to the
binary wheels that cryptography (pyOpenSSL's primary dependency) ships:

*   macOS will only load certificates using this method if the user has
    the ``openssl@1.1`` `Homebrew <https://brew.sh>`_ formula installed
    in the default location.
*   Windows will not work.
*   manylinux cryptography wheels will work on most common Linux
    distributions in pyOpenSSL 17.1.0 and above.  pyOpenSSL detects the
    manylinux wheel and attempts to load roots via a fallback path.

:return: None
r1  ÚasciiN)r¢   Ú SSL_CTX_set_default_verify_pathsrÏ  rË  rK  r±  ÚX509_get_default_cert_dir_envÚdecodeÚX509_get_default_cert_file_envÚ_check_env_vars_setÚX509_get_default_cert_dirÚX509_get_default_cert_fileÚ_CRYPTOGRAPHY_MANYLINUX_CA_DIRÚ_CRYPTOGRAPHY_MANYLINUX_CA_FILEÚ_fallback_default_verify_pathsÚ_CERTIFICATE_FILE_LOCATIONSÚ_CERTIFICATE_PATH_LOCATIONS)r"  Ú
set_resultÚdir_env_varÚfile_env_varÚdefault_dirÚdefault_files         rž   Úset_default_verify_pathsÚ Context.set_default_verify_paths÷  sï   € ô( ×:Ò:¸4¿=¹=ÓIˆ
Ü˜
 a™Ô(ô —k’k¤$×"DÒ"DÓ"FÓG×NÑNØó
ˆô —{’{Ü×/Ò/Ó1ó
ç
‰&�‹/ð 	ð ×'Ñ'¨×BÑBÜŸ+š+¤d×&DÒ&DÓ&FÓGˆKÜŸ;š;¤t×'FÒ'FÓ'HÓIˆLð
 Ô=Ó=Ø Ô$CÓCð ×3Ñ3Ü/Ô1Lõð Dð >ð Cr�   c                ó”   • [         R                  R                  U5      SL=(       d!    [         R                  R                  U5      SL$ )zX
Check to see if the default cert dir/file environment vars are present.

:return: bool
N)ÚosÚenvironÚget)r"  r  r  s      rž   r  ÚContext._check_env_vars_set'  s8   € ô �J‰J�N‰N˜<Ó(°Ð4÷ 7Ü�z‰z�~‰~˜kÓ*°$Ð6ð	
r�   c                ó  • U H:  n[         R                  R                  U5      (       d  M)  U R                  U5          O   U H;  n[         R                  R	                  U5      (       d  M)  U R                  SU5          g   g)a  
Default verify paths are based on the compiled version of OpenSSL.
However, when pyca/cryptography is compiled as a manylinux wheel
that compiled location can potentially be wrong. So, like Go, we
will try a predefined set of paths and attempt to load roots
from there.

:return: None
N)r   ÚpathÚisfilerø  Úisdir)r"  Ú	file_pathÚdir_pathrõ  rö  s        rž   r  Ú&Context._fallback_default_verify_paths2  sd   € ó  ˆFÜ�w‰w�~‰~˜f×%Ó%Ø×*Ñ*¨6Ô2Ùñ  ó
 ˆFÜ�w‰w�}‰}˜V×$Ó$Ø×*Ñ*¨4°Ô8Ùò r�   c                ó€   • [        U5      n[        R                  " U R                  U5      nU(       d  [	        5         gg)z¡
Load a certificate chain from a file.

:param certfile: The name of the certificate chain file (``bytes`` or
    ``str``).  Must be PEM encoded.

:return: None
N)ró  r¢   Ú"SSL_CTX_use_certificate_chain_filerÏ  r&  )r"  ÚcertfilerE  s      rž   Úuse_certificate_chain_fileÚ"Context.use_certificate_chain_fileH  s7   € ô ˜xÓ(ˆä×8Ò8Ø�M‰M˜8ó
ˆö Ü Õ"ð r�   c                óÀ   • [        U5      n[        U[        5      (       d  [        S5      e[        R
                  " U R                  X5      nU(       d  [        5         gg)a$  
Load a certificate from a file

:param certfile: The name of the certificate file (``bytes`` or
    ``str``).
:param filetype: (optional) The encoding of the file, which is either
    :const:`FILETYPE_PEM` or :const:`FILETYPE_ASN1`.  The default is
    :const:`FILETYPE_PEM`.

:return: None
úfiletype must be an integerN)ró  rW  r…   rY  r¢   ÚSSL_CTX_use_certificate_filerÏ  r&  )r"  r-  ÚfiletypeÚ
use_results       rž   Úuse_certificate_fileÚContext.use_certificate_fileY  sP   € ô ˜xÓ(ˆÜ˜(¤C×(Ñ(ÜÐ9Ó:Ð:ä×6Ò6Ø�M‰M˜8ó
ˆ
ö Ü Õ"ð r�   c                ó
  • [        U[        5      (       d  [        R                  " U5      nO[        R                  " S[
        SS9  [        R                  " U R                  UR                  5      nU(       d  [        5         gg©zS
Load a certificate from a X509 object

:param cert: The X509 object
:return: None
úePassing pyOpenSSL X509 objects is deprecated. You should use a cryptography.x509.Certificate instead.rt  ©Ú
stacklevelN)rW  r   Úfrom_cryptographyÚwarningsÚwarnÚDeprecationWarningr¢   ÚSSL_CTX_use_certificaterÏ  Ú_x509r&  ©r"  r?  r4  s      rž   Úuse_certificateÚContext.use_certificateq  se   € ô ˜$¤×%Ñ%Ü×)Ò)¨$Ó/‰Dä�MŠMðJô #Øòô ×1Ò1°$·-±-ÀÇÁÓLˆ
ÞÜ Õ"ð r�   c                ób  • [        U[        5      (       d  [        R                  " U5      nO[        R                  " S[
        SS9  [        R                  " UR                  5      n[        R                  " U R                  U5      nU(       d!  [        R                  " U5        [        5         gg)zi
Add certificate to chain

:param certobj: The X509 certificate object to add to the chain
:return: None
r9  rt  r:  N)rW  r   r<  r=  r>  r?  r¢   ÚX509_duprA  ÚSSL_CTX_add_extra_chain_certrÏ  Ú	X509_freer&  )r"  ÚcertobjÚcopyÚ
add_results       rž   Úadd_extra_chain_certÚContext.add_extra_chain_cert‰  s   € ô ˜'¤4×(Ñ(Ü×,Ò,¨WÓ5‰Gä�MŠMðJô #Øòô �}Š}˜WŸ]™]Ó+ˆÜ×6Ò6°t·}±}ÀdÓKˆ
Þä�NŠN˜4Ô Ü Õ"ð r�   c                óp   • U R                   b  U R                   R                  [        5        [        5         g r  )rÐ  r(  rr   r&  r!  s    rž   Ú_raise_passphrase_exceptionÚ#Context._raise_passphrase_exception£  s(   € Ø×"Ñ"Ñ.Ø×#Ñ#×4Ñ4´UÔ;äÕr�   c                óÌ   • [        U5      n[        U[        5      (       d  [        S5      e[        R
                  " U R                  X5      nU(       d  U R                  5         gg)a  
Load a private key from a file

:param keyfile: The name of the key file (``bytes`` or ``str``)
:param filetype: (optional) The encoding of the file, which is either
    :const:`FILETYPE_PEM` or :const:`FILETYPE_ASN1`.  The default is
    :const:`FILETYPE_PEM`.

:return: None
r1  N)ró  rW  r…   rY  r¢   ÚSSL_CTX_use_PrivateKey_filerÏ  rO  )r"  Úkeyfiler3  r4  s       rž   Úuse_privatekey_fileÚContext.use_privatekey_file©  sV   € ô ˜gÓ&ˆä˜(¤C×(Ñ(ÜÐ9Ó:Ð:ä×5Ò5Ø�M‰M˜7ó
ˆ
ö Ø×,Ñ,Õ.ð r�   c                ó  • [        U[        5      (       d  [        R                  " U5      nO[        R                  " S[
        SS9  [        R                  " U R                  UR                  5      nU(       d  U R                  5         gg©zS
Load a private key from a PKey object

:param pkey: The PKey object
:return: None
z`Passing pyOpenSSL PKey objects is deprecated. You should use a cryptography private key instead.rt  r:  N)rW  r   Úfrom_cryptography_keyr=  r>  r?  r¢   ÚSSL_CTX_use_PrivateKeyrÏ  Ú_pkeyrO  ©r"  Úpkeyr4  s      rž   Úuse_privatekeyÚContext.use_privatekeyÁ  sk   € ô ˜$¤×%Ñ%Ü×-Ò-¨dÓ3‰Dä�MŠMðEô #Øòô ×0Ò0°·±ÀÇ
Á
ÓKˆ
ÞØ×,Ñ,Õ.ð r�   c                ód   • [         R                  " U R                  5      (       d  [        5         gg)z¿
Check if the private key (loaded with :meth:`use_privatekey`) matches
the certificate (loaded with :meth:`use_certificate`)

:return: :data:`None` (raises :exc:`Error` if something's wrong)
N)r¢   ÚSSL_CTX_check_private_keyrÏ  r&  r!  s    rž   Úcheck_privatekeyÚContext.check_privatekeyÙ  s$   € ô ×-Ò-¨d¯m©m×<Ñ<Ü Õ"ð =r�   c                ó¾   • [         R                  " [        SU5      5      n[        U[        R
                  :g  5        [         R                  " U R                  U5        g)zõ
Load the trusted certificates that will be sent to the client.  Does
not actually imply any of the certificates are trusted; that must be
configured separately.

:param bytes cafile: The path to a certificates file in PEM format.
:return: None
rõ  N)r¢   ÚSSL_load_client_CA_fileÚ_text_to_bytes_and_warnrË  rK  ru  ÚSSL_CTX_set_client_CA_listrÏ  )r"  rõ  Úca_lists      rž   Úload_client_caÚContext.load_client_caã  sE   € ô ×.Ò.Ü# H¨fÓ5ó
ˆô 	˜¤4§9¡9Ñ,Ô-Ü×'Ò'¨¯©°wÕ?r�   c           	     óŠ   • [        SU5      n[        [        R                  " U R                  U[        U5      5      S:H  5        g)a  
Set the session id to *buf* within which a session can be reused for
this Context object.  This is needed when doing session resumption,
because there is no way for a stored session to know which Context
object it is associated with.

:param bytes buf: The session id.

:returns: None
Úbufr1  N)re  rË  r¢   ÚSSL_CTX_set_session_id_contextrÏ  r[  )r"  rk  s     rž   Úset_session_idÚContext.set_session_idò  s:   € ô & e¨SÓ1ˆÜÜ×/Ò/°·±¸sÄCÈÃHÓMØñõ	
r�   c                ó„   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  U5      $ )aN  
Set the behavior of the session cache used by all connections using
this Context.  The previously set mode is returned.  See
:const:`SESS_CACHE_*` for details about particular modes.

:param mode: One or more of the SESS_CACHE_* flags (combine using
    bitwise or)
:returns: The previously set caching mode.

.. versionadded:: 0.14
úmode must be an integer)rW  r…   rY  r¢   ÚSSL_CTX_set_session_cache_moderÏ  ©r"  Úmodes     rž   Úset_session_cache_modeÚContext.set_session_cache_mode  s4   € ô ˜$¤×$Ñ$ÜÐ5Ó6Ð6ä×2Ò2°4·=±=À$ÓGÐGr�   c                óB   • [         R                  " U R                  5      $ )zg
Get the current session cache mode.

:returns: The currently used cache mode.

.. versionadded:: 0.14
)r¢   ÚSSL_CTX_get_session_cache_moderÏ  r!  s    rž   Úget_session_cache_modeÚContext.get_session_cache_mode  s   € ô ×2Ò2°4·=±=ÓAÐAr�   c                óª  • [        U[        5      (       d  [        S5      eUc?  SU l        SU l        [
        R                  " U R                  U[        R                  5        g[        U5      (       d  [        S5      e[        U5      U l        U R                  R                  U l        [
        R                  " U R                  XR                  5        g)aZ  
Set the verification flags for this Context object to *mode* and
specify that *callback* should be used for verification callbacks.

:param mode: The verify mode, this should be one of
    :const:`VERIFY_NONE` and :const:`VERIFY_PEER`. If
    :const:`VERIFY_PEER` is used, *mode* can be OR:ed with
    :const:`VERIFY_FAIL_IF_NO_PEER_CERT` and
    :const:`VERIFY_CLIENT_ONCE` to further control the behaviour.
:param callback: The optional Python verification callback to use.
    This should take five arguments: A Connection object, an X509
    object, and three integer variables, which are in turn potential
    error number, error depth and return code. *callback* should
    return True if verification passes and False otherwise.
    If omitted, OpenSSL's default verification is used.
:return: None

See SSL_CTX_set_verify(3SSL) for further details.
rp  Nr  )rW  r…   rY  rÓ  rÔ  r¢   ÚSSL_CTX_set_verifyrÏ  rK  ru  r  r.  rG  ©r"  rs  rG  s      rž   Ú
set_verifyÚContext.set_verify  sŸ   € ô, ˜$¤×$Ñ$ÜÐ5Ó6Ð6àÑØ"&ˆDÔØ$(ˆDÔ!Ü×#Ò# D§M¡M°4¼¿¹ÕCä˜H×%Ñ%ÜÐ ;Ó<Ð<ä"/°Ó"9ˆDÔØ$(×$7Ñ$7×$@Ñ$@ˆDÔ!Ü×#Ò# D§M¡M°4×9NÑ9NÕOr�   c                ó†   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  U5        g)z±
Set the maximum depth for the certificate chain verification that shall
be allowed for this Context object.

:param depth: An integer specifying the verify depth
:return: None
zdepth must be an integerN)rW  r…   rY  r¢   ÚSSL_CTX_set_verify_depthrÏ  )r"  Údepths     rž   Úset_verify_depthÚContext.set_verify_depthC  s1   € ô ˜%¤×%Ñ%ÜÐ6Ó7Ð7ä×%Ò% d§m¡m°UÕ;r�   c                óB   • [         R                  " U R                  5      $ )zd
Retrieve the Context object's verify mode, as set by
:meth:`set_verify`.

:return: The verify mode
)r¢   ÚSSL_CTX_get_verify_moderÏ  r!  s    rž   Úget_verify_modeÚContext.get_verify_modeP  s   € ô ×+Ò+¨D¯M©MÓ:Ð:r�   c                óB   • [         R                  " U R                  5      $ )zl
Retrieve the Context object's verify depth, as set by
:meth:`set_verify_depth`.

:return: The verify depth
)r¢   ÚSSL_CTX_get_verify_depthrÏ  r!  s    rž   Úget_verify_depthÚContext.get_verify_depthY  s   € ô ×,Ò,¨T¯]©]Ó;Ð;r�   c                óü  • [        U5      n[        R                  " US5      nU[        R                  :X  a
  [        5         [        R                  " U[        R                  5      n[        R                  " U[        R                  [        R                  [        R                  5      n[        R                  " U[        R                  5      n[        R                  " U R                  U5      n[        US:H  5        g)zŽ
Load parameters for Ephemeral Diffie-Hellman

:param dhfile: The file to load EDH parameters from (``bytes`` or
    ``str``).

:return: None
ó   rr1  N)ró  r¢   ÚBIO_new_filerK  ru  r&  rÍ  ÚBIO_freeÚPEM_read_bio_DHparamsÚDH_freeÚSSL_CTX_set_tmp_dhrÏ  rË  )r"  ÚdhfileÚbioÚdhÚress        rž   Úload_tmp_dhÚContext.load_tmp_dhb  sž   € ô ˜VÓ$ˆä×Ò ¨Ó-ˆØ”$—)‘)ÓÜ Ô"Ü�gŠg�cœ4Ÿ=™=Ó)ˆä×'Ò'¨¬T¯Y©Y¼¿	¹	Ä4Ç9Á9ÓMˆÜ�WŠW�RœŸ™Ó&ˆÜ×%Ò% d§m¡m°RÓ8ˆÜ˜˜q™Õ!r�   c                óp  • [        U[        5      (       aJ  [        R                  " S[        SS9  [
        R                  " U R                  UR                  5       5        gUR                  nUS:X  a  SnOUS:X  a  Sn[
        R                  " UR                  5       5      nU[
        R                  :X  a
  [        5         [
        R                  " U5      n[        U[         R"                  :g  5        [         R$                  " U[
        R&                  5      n[
        R                  " U R                  U5        g)	aZ  
Select a curve to use for ECDHE key exchange.

:param curve: A curve instance from cryptography
    (:class:`~cryptogragraphy.hazmat.primitives.asymmetric.ec.EllipticCurve`).
    Alternatively (deprecated) a curve object from either
    :meth:`OpenSSL.crypto.get_elliptic_curve` or
    :meth:`OpenSSL.crypto.get_elliptic_curves`.

:return: None
z|Passing pyOpenSSL elliptic curves to set_tmp_ecdh is deprecated. You should use cryptography's elliptic curve types instead.rt  r:  Ú	secp192r1Ú
prime192v1Ú	secp256r1Ú
prime256v1N)rW  r   r=  r>  r?  r¢   ÚSSL_CTX_set_tmp_ecdhrÏ  Ú
_to_EC_KEYÚnameÚOBJ_txt2nidÚencodeÚ	NID_undefr&  ÚEC_KEY_new_by_curve_namerË  rK  ru  rÍ  ÚEC_KEY_free)r"  Úcurver   Únidr   s        rž   Úset_tmp_ecdhÚContext.set_tmp_ecdhw  sÞ   € ô �eœ^×,Ñ,Ü�MŠMð%ô #Øòô ×%Ò% d§m¡m°U×5EÑ5EÓ5GÕHà—:‘:ˆDØ�{Ó"Ø#‘Ø˜Ó$Ø#�Ü×"Ò" 4§;¡;£=Ó1ˆCØ”d—n‘nÓ$Ü$Ô&ä×.Ò.¨sÓ3ˆBÜ˜B¤$§)¡)™OÔ,Ü—’˜œT×-Ñ-Ó.ˆBÜ×%Ò% d§m¡m°RÕ8r�   c                ó  • [        SU5      n[        U[        5      (       d  [        S5      e[	        [
        R                  " U R                  U5      S:H  5        [        U S5      nUR                  5       / SQ:X  a  [        S/5      eg)zÃ
Set the list of ciphers to be used in this context.

See the OpenSSL manual for more information (e.g.
:manpage:`ciphers(1)`).

:param bytes cipher_list: An OpenSSL cipher string.
:return: None
Úcipher_listz"cipher_list must be a byte string.r1  N)ÚTLS_AES_256_GCM_SHA384ÚTLS_CHACHA20_POLY1305_SHA256ÚTLS_AES_128_GCM_SHA256)zSSL routinesÚSSL_CTX_set_cipher_listzno cipher match)re  rW  rX  rY  rË  r¢   r¯  rÏ  rp   Úget_cipher_listrr   )r"  r«  Útmpconns      rž   Úset_cipher_listÚContext.set_cipher_listž  sŒ   € ô .¨m¸[ÓIˆä˜+¤u×-Ñ-ÜÐ@ÓAÐAäÜ×(Ò(¨¯©¸ÓDÈÑIô	
ô ˜T 4Ó(ˆØ×"Ñ"Ó$ò )
ó 
ô
 ððóð ð
r�   c                ój  • [         R                  " 5       n[        U[        R                  :g  5         U Hµ  n[        U[        5      (       d"  [        S[        U5      R                   S35      e[         R                  " UR                  5      n[        U[        R                  :g  5        [         R                  " X$5      nU(       a  M•  [         R                  " U5        [        5         M·     [         R"                  " U R$                  U5        g! [         a    [         R                   " U5        e f = f)a  
Set the list of preferred client certificate signers for this server
context.

This list of certificate authorities will be sent to the client when
the server requests a client certificate.

:param certificate_authorities: a sequence of X509Names.
:return: None

.. versionadded:: 0.10
z)client CAs must be X509Name objects, not z objectsN)r¢   Úsk_X509_NAME_new_nullrË  rK  ru  rW  r   rY  r³  r˜   ÚX509_NAME_dupÚ_nameÚsk_X509_NAME_pushÚX509_NAME_freer&  r;  Úsk_X509_NAME_freerf  rÏ  )r"  Úcertificate_authoritiesÚ
name_stackÚca_namerJ  Úpush_results         rž   Úset_client_ca_listÚContext.set_client_ca_listÅ  sî   € ô ×/Ò/Ó1ˆ
Ü˜
¤d§i¡iÑ/Ô0ð	Û2�Ü! '¬8×4Ñ4Ü#ØCÜ ›=×1Ñ1Ð2°(ð<óð ô ×)Ò)¨'¯-©-Ó8�Ü ¬¯	©	Ñ 1Ô2Ü"×4Ò4°ZÓF�ß"�{Ü×'Ò'¨Ô-Ü(Ö*ñ 3ô  	×'Ò'¨¯©°zÕBøô	 ó 	Ü×"Ò" :Ô.Øð	ús   ³BD Ã
$D Ä"D2c                ó  • [        U[        5      (       d  [        R                  " U5      nO[        R                  " S[
        SS9  [        R                  " U R                  UR                  5      n[        US:H  5        g)a)  
Add the CA certificate to the list of preferred signers for this
context.

The list of certificate authorities will be sent to the client when the
server requests a client certificate.

:param certificate_authority: certificate authority's X509 certificate.
:return: None

.. versionadded:: 0.10
r9  rt  r:  r1  N)rW  r   r<  r=  r>  r?  r¢   ÚSSL_CTX_add_client_CArÏ  rA  rË  )r"  Úcertificate_authorityrK  s      rž   Úadd_client_caÚContext.add_client_caê  sr   € ô Ð/´×6Ñ6Ü$(×$:Ò$:Ø%ó%Ñ!ô �MŠMðJô #Øòô ×/Ò/Ø�M‰MÐ0×6Ñ6ó
ˆ
ô 	˜
 a™Õ(r�   c                ó„   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  U5      $ )a!  
Set the timeout for newly created sessions for this Context object to
*timeout*.  The default value is 300 seconds. See the OpenSSL manual
for more information (e.g. :manpage:`SSL_CTX_set_timeout(3)`).

:param timeout: The timeout in (whole) seconds
:return: The previous session timeout
ztimeout must be an integer)rW  r…   rY  r¢   ÚSSL_CTX_set_timeoutrÏ  )r"  Útimeouts     rž   Úset_timeoutÚContext.set_timeout  s4   € ô ˜'¤3×'Ñ'ÜÐ8Ó9Ð9ä×'Ò'¨¯©°wÓ?Ð?r�   c                óB   • [         R                  " U R                  5      $ )zt
Retrieve session timeout, as set by :meth:`set_timeout`. The default
is 300 seconds.

:return: The session timeout
)r¢   ÚSSL_CTX_get_timeoutrÏ  r!  s    rž   Úget_timeoutÚContext.get_timeout  s   € ô ×'Ò'¨¯©Ó6Ð6r�   c                ó¼   ^• [        T5      U4S j5       n[        R                  " SU5      U l        [        R
                  " U R                  U R                  5        g)a¨  
Set the information callback to *callback*. This function will be
called from time to time during SSL handshakes.

:param callback: The Python callback to use.  This should take three
    arguments: a Connection object and two integers.  The first integer
    specifies where in the SSL handshake the function was called, and
    the other the return code from a (possibly failed) internal
    function call.
:return: None
c                ó:   >• T" [         R                  U    X5        g r  )rp   r9  )rC  ÚwhereÚreturn_coderG  s      €rž   rH  Ú*Context.set_info_callback.<locals>.wrapper2  s   ø€ á”Z×0Ñ0°Ñ5°uÕJr�   zvoid (*)(const SSL *, int, int)N)r   rK  rG  rÕ  r¢   ÚSSL_CTX_set_info_callbackrÏ  rL  s    ` rž   Úset_info_callbackÚContext.set_info_callback#  sQ   ø€ ô 
ˆx‹ô	Kó 
ð	Kô #ŸmšmØ-¨wó
ˆÔô 	×&Ò& t§}¡}°d×6IÑ6IÕJr�   c                ó¼   ^• [        T5      U4S j5       n[        R                  " SU5      U l        [        R
                  " U R                  U R                  5        g)aÆ  
Set the TLS key logging callback to *callback*. This function will be
called whenever TLS key material is generated or received, in order
to allow applications to store this keying material for debugging
purposes.

:param callback: The Python callback to use.  This should take two
    arguments: a Connection object and a bytestring that contains
    the key material in the format used by NSS for its SSLKEYLOGFILE
    debugging output.
:return: None
c                óf   >• [         R                  " U5      nT" [        R                  U    U5        g r  )rK  r±  rp   r9  )rC  ÚlinerG  s     €rž   rH  Ú,Context.set_keylog_callback.<locals>.wrapperL  s&   ø€ ä—;’;˜tÓ$ˆDÙ”Z×0Ñ0°Ñ5°tÕ<r�   z#void (*)(const SSL *, const char *)N)r   rK  rG  rÖ  r¢   ÚSSL_CTX_set_keylog_callbackrÏ  rL  s    ` rž   Úset_keylog_callbackÚContext.set_keylog_callback;  sO   ø€ ô" 
ˆx‹ô	=ó 
ð	=ô !%§¢Ø1°7ó!
ˆÔô 	×(Ò(¨¯©¸×8MÑ8MÕNr�   c                ó   • U R                   $ )z_
Get the application data (supplied via :meth:`set_app_data()`)

:return: The application data
©rØ  r!  s    rž   Úget_app_dataÚContext.get_app_dataV  ó   € ð �~‰~Ðr�   c                ó   • Xl         g)zo
Set the application data (will be returned from get_app_data())

:param data: Any Python object
:return: None
Nrß  ©r"  rz  s     rž   Úset_app_dataÚContext.set_app_data^  ó	   € ð �r�   c                ó°   • [         R                  " U R                  5      nU[        R                  :X  a  g[
        R                  " [
        5      nXl        U$ )zÒ
Get the certificate store for the context.  This can be used to add
"trusted" certificates without using the
:meth:`load_verify_locations` method.

:return: A X509Store object or None if it does not have one.
N)r¢   ÚSSL_CTX_get_cert_storerÏ  rK  ru  r   Ú__new__Ú_store)r"  ÚstoreÚpystores      rž   Úget_cert_storeÚContext.get_cert_storeg  sA   € ô ×+Ò+¨D¯M©MÓ:ˆØ”D—I‘IÓàä×#Ò#¤IÓ.ˆØŒØˆr�   c                ó„   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  U5      $ )zµ
Add options. Options set before are not cleared!
This method should be used with the :const:`OP_*` constants.

:param options: The options to add.
:return: The new option bitmask.
zoptions must be an integer)rW  r…   rY  r¢   ÚSSL_CTX_set_optionsrÏ  )r"  Úoptionss     rž   Úset_optionsÚContext.set_optionsx  s4   € ô ˜'¤3×'Ñ'ÜÐ8Ó9Ð9ä×'Ò'¨¯©°wÓ?Ð?r�   c                ó„   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  U5      $ )z¸
Add modes via bitmask. Modes set before are not cleared!  This method
should be used with the :const:`MODE_*` constants.

:param mode: The mode to add.
:return: The new mode bitmask.
rp  )rW  r…   rY  r¢   ÚSSL_CTX_set_moderÏ  rr  s     rž   rà  ÚContext.set_mode…  s4   € ô ˜$¤×$Ñ$ÜÐ5Ó6Ð6ä×$Ò$ T§]¡]°DÓ9Ð9r�   c                ó¼   ^• [        T5      U4S j5       n[        R                  " SU5      U l        [        R
                  " U R                  U R                  5        g)zÓ
Specify a callback function to be called when clients specify a server
name.

:param callback: The callback function.  It will be invoked with one
    argument, the Connection instance.

.. versionadded:: 0.13
c                óÆ   >•  T" [         R                  U    5        g! [         a9    [        R                  " [        R
                  " 5       6   [        R                  s $ f = fr¢  )rp   r9  r;  ÚsysÚ
excepthookÚexc_infor¢   r_  )rC  Úalertrd  rG  s      €rž   rH  Ú7Context.set_tlsext_servername_callback.<locals>.wrapperŸ  sO   ø€ ð7Ùœ×4Ñ4°SÑ9Ô:ð øô ó 7Ü—’¤§¢£Ñ/Ü×6Ñ6Ò6ð7ús   ƒ �A A ÁA zint (*)(SSL *, int *, void *)N)r   rK  rG  r×  r¢   Ú&SSL_CTX_set_tlsext_servername_callbackrÏ  rL  s    ` rž   Úset_tlsext_servername_callbackÚ&Context.set_tlsext_servername_callback’  sR   ø€ ô 
ˆx‹ô	ó 
ð	ô ,0¯=ª=Ø+¨Wó,
ˆÔ(ô 	×3Ò3Ø�M‰M˜4×;Ñ;õ	
r�   c                óž   • [        U[        5      (       d  [        S5      e[        [        R
                  " U R                  U5      S:H  5        g)zÏ
Enable support for negotiating SRTP keying material.

:param bytes profiles: A colon delimited list of protection profile
    names, like ``b'SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32'``.
:return: None
zprofiles must be a byte string.r   N)rW  rX  rY  rË  r¢   ÚSSL_CTX_set_tlsext_use_srtprÏ  )r"  Úprofiless     rž   Úset_tlsext_use_srtpÚContext.set_tlsext_use_srtp¯  s>   € ô ˜(¤E×*Ñ*ÜÐ=Ó>Ð>äÜ×,Ò,¨T¯]©]¸HÓEÈÑJõ	
r�   c           	     ó  • U(       d  [        S5      eSR                  [        R                  " S U 5       5      5      n[        R
                  " SU5      n[        [        R                  " U R                  U[        U5      5      S:H  5        g)a]  
Specify the protocols that the client is prepared to speak after the
TLS connection has been negotiated using Application Layer Protocol
Negotiation.

:param protos: A list of the protocols to be offered to the server.
    This list should be a Python list of bytestrings representing the
    protocols to offer, e.g. ``[b'http/1.1', b'spdy/2']``.
ú'at least one protocol must be specifiedr�   c              3  óP   #   • U  H  n[        [        U5      45      U4v •  M     g 7fr  ©rX  r[  ©Ú.0Úps     rž   Ú	<genexpr>Ú*Context.set_alpn_protos.<locals>.<genexpr>Ñ  ó    é € ÐFºv¸!¤¬¨A« yÓ!1°1Õ 5ºvùó   ‚$&rU  r   N)r•  Újoinr   Úfrom_iterablerK  rZ  rË  r¢   ÚSSL_CTX_set_alpn_protosrÏ  r[  ©r"  ÚprotosÚprotostrÚ	input_strs       rž   Úset_alpn_protosÚContext.set_alpn_protos¾  s{   € ö ÜÐFÓGÐGð —8‘8Ü×ÒÑF¹vÓFÓFó
ˆô —H’HÐ.°Ó9ˆ	ô 	Ü×(Ò(Ø—‘˜y¬#¨h«-óð ñõ	
r�   c                óÎ   • [        U5      U l        U R                  R                  U l        [        R
                  " U R                  U R                  [        R                  5        g)aD  
Specify a callback function that will be called on the server when a
client offers protocols using ALPN.

:param callback: The callback function.  It will be invoked with two
    arguments: the Connection, and a list of offered protocols as
    bytestrings, e.g ``[b'http/1.1', b'spdy/2']``.  It can return
    one of those bytestrings to indicate the chosen protocol, the
    empty bytestring to terminate the TLS connection, or the
    :py:obj:`NO_OVERLAPPING_PROTOCOLS` to indicate that no offered
    protocol was selected, but that the connection should not be
    aborted.
N)	rR  rÙ  rG  rÚ  r¢   ÚSSL_CTX_set_alpn_select_cbrÏ  rK  ru  ©r"  rG  s     rž   Úset_alpn_select_callbackÚ Context.set_alpn_select_callbackã  sH   € ô $5°XÓ#>ˆÔ Ø%)×%=Ñ%=×%FÑ%FˆÔ"Ü×'Ò'Ø�M‰M˜4×5Ñ5´t·y±yõ	
r�   c                ó~  • Xl         UR                  U l        Uc  [        R                  U l        O[        R                  " U5      U l        [        R                  " U R                  U R                  5      n[        US:H  5        [        R                  " U R                  U R
                  5      n[        US:H  5        g)z‰
This internal helper does the common work for
``set_ocsp_server_callback`` and ``set_ocsp_client_callback``, which is
almost all of it.
Nr1  )rÛ  rG  rÜ  rK  ru  rÝ  Ú
new_handler¢   ÚSSL_CTX_set_tlsext_status_cbrÏ  rË  ÚSSL_CTX_set_tlsext_status_arg)r"  Úhelperrz  Úrcs       rž   Ú_set_ocsp_callbackÚContext._set_ocsp_callback÷  s‰   € ð #ÔØ$Ÿo™oˆÔØ‰<Ü"Ÿi™iˆD�Oä"Ÿošo¨dÓ3ˆDŒOä×.Ò.Ø�M‰M˜4×.Ñ.ó
ˆô 	˜˜a™Ô Ü×/Ò/°·±¸t¿¹ÓOˆÜ˜˜a™Õ r�   c                ó<   • [        U5      nU R                  X25        g)a›  
Set a callback to provide OCSP data to be stapled to the TLS handshake
on the server side.

:param callback: The callback function. It will be invoked with two
    arguments: the Connection, and the optional arbitrary data you have
    provided. The callback must return a bytestring that contains the
    OCSP data to staple to the handshake. If no OCSP data is available
    for this connection, return the empty bytestring.
:param data: Some opaque data that will be passed into the callback
    function when called. This can be used to avoid needing to do
    complex data lookups or to keep track of what context is being
    used. This parameter is optional.
N)rq  r&  ©r"  rG  rz  r$  s       rž   Úset_ocsp_server_callbackÚ Context.set_ocsp_server_callback  s   € ô& +¨8Ó4ˆØ×Ñ Õ-r�   c                ó<   • [        U5      nU R                  X25        g)a  
Set a callback to validate OCSP data stapled to the TLS handshake on
the client side.

:param callback: The callback function. It will be invoked with three
    arguments: the Connection, a bytestring containing the stapled OCSP
    assertion, and the optional arbitrary data you have provided. The
    callback must return a boolean that indicates the result of
    validating the OCSP data: ``True`` if the OCSP data is valid and
    the certificate can be trusted, or ``False`` if either the OCSP
    data is invalid or the certificate has been revoked.
:param data: Some opaque data that will be passed into the callback
    function when called. This can be used to avoid needing to do
    complex data lookups or to keep track of what context is being
    used. This parameter is optional.
N)r‚  r&  r)  s       rž   Úset_ocsp_client_callbackÚ Context.set_ocsp_client_callback%  s   € ô* +¨8Ó4ˆØ×Ñ Õ-r�   c                óŽ   • [        U5      U l        [        R                  " U R                  U R                  R
                  5        g r  )r�  rÞ  r¢   ÚSSL_CTX_set_cookie_generate_cbrÏ  rG  r  s     rž   Úset_cookie_generate_callbackÚ$Context.set_cookie_generate_callback=  s6   € ô (EÀXÓ'NˆÔ$Ü×+Ò+Ø�M‰MØ×(Ñ(×1Ñ1õ	
r�   c                óŽ   • [        U5      U l        [        R                  " U R                  U R                  R
                  5        g r  )rŸ  rß  r¢   ÚSSL_CTX_set_cookie_verify_cbrÏ  rG  r  s     rž   Úset_cookie_verify_callbackÚ"Context.set_cookie_verify_callbackF  s6   € ô &AÀÓ%JˆÔ"Ü×)Ò)Ø�M‰MØ×&Ñ&×/Ñ/õ	
r�   )rÚ  rÙ  rØ  rÏ  rÞ  rß  rÕ  rÖ  rÜ  rÝ  rÛ  rÑ  rÐ  rÒ  r×  rÔ  rÓ  )rä  r…   r+  r,  )ræ  r…   r+  r,  r  )rõ  ú_StrOrBytesPath | Nonerö  r7  r+  r,  )rG  ú_PassphraseCallback[_T]r+  r    )rG  r8  rþ  ú	_T | Noner+  r,  r*  )r  Ústrr  r:  r+  rˆ  )r(  ú	list[str]r)  r;  r+  r,  )r-  Ú_StrOrBytesPathr+  r,  )r-  r<  r3  r…   r+  r,  ©r?  úX509 | x509.Certificater+  r,  )rI  r>  r+  r,  )rS  r<  r3  r…   r+  r,  ©r\  z_PrivateKey | PKeyr+  r,  )rõ  rX  r+  r,  )rk  rX  r+  r,  )rs  r…   r+  r…   ©r+  r…   ©rs  r…   rG  z_VerifyCallback | Noner+  r,  )r�  r…   r+  r,  )r“  r<  r+  r,  )r¦  z!_EllipticCurve | ec.EllipticCurver+  r,  )r«  rX  r+  r,  )r»  zSequence[X509Name]r+  r,  )rÃ  r>  r+  r,  )rÈ  r…   r+  r,  )rG  z&Callable[[Connection, int, int], None]r+  r,  )rG  z#Callable[[Connection, bytes], None]r+  r,  ©r+  r   ©rz  r   r+  r,  )r+  zX509Store | None)rò  r…   r+  r…   )rG  zCallable[[Connection], None]r+  r,  )r  rX  r+  r,  ©r  zlist[bytes]r+  r,  rn  )r$  z5_OCSPClientCallbackHelper | _OCSPServerCallbackHelperrz  z
Any | Noner+  r,  )rG  z_OCSPServerCallback[_T]rz  r9  r+  r,  )rG  z_OCSPClientCallback[_T]rz  r9  r+  r,  r›  r§  )Nr˜   r™   rš   r›   r¡   rz   r¢   Ú
TLS_methodr   rh   r}   re   r~   rf   rj   rk   ÚTLS_server_methodri   ÚTLS_client_methodr#   ÚDTLS_methodr$   ÚDTLS_server_methodr"   ÚDTLS_client_methodrÈ  rÆ  r#  râ  rã  rø  r  r  r  r  r  r.  r   r5  rC  rL  rO  rT  r]  ra  rh  rm  rt  rx  r}  r‚  r†  rŠ  r—  r¨  r²  r¿  rÄ  rÉ  rÍ  rÕ  Ú_requires_keylogrÜ  rà  rå  rî  ró  rà  r   r  r  r  r&  r*  r-  r1  r5  rœ   r–   r�   rž   rq   rq   F  sa  ‡ ñð 	˜Ÿ™¨Ð.Ø�t—‘¨Ð5Ø˜Ÿ™¨.Ð9Ø˜Ÿ™¨.Ð9Ø�T—_‘_ dÐ+Ø˜D×2Ñ2°DÐ9Ø˜D×2Ñ2°DÐ9Ø�d×&Ñ&¨Ð-Ø˜T×4Ñ4°dÐ;Ø˜T×4Ñ4°dÐ;ð	ð ð ó ô+0ôZ
ô
ð  *.ð"#à&ð"#ð 'ð"#ð 
õ	"#ðH	
Ø/ð	
à	ô	
ð #ð-à)ð-ð ð-ð 
õ	-ôB.ô`	
ðØ"ðØ.7ðà	ôô,#ð$ :Fð#Ø'ð#Ø36ð#à	õ#ô0#ô0#ô4ð 9Eð/Ø&ð/Ø25ð/à	õ/ô0/ô0#ô@ô
ô"Hô"Bð =Að#PØð#PØ#9ð#Pà	õ#PôJ<ô;ô<ô"ô*%9ôN%ðN#CØ'9ð#Cà	ô#CðJ )Ø%<ð )à	ô )ôD@ô7ðKØ>ðKà	ôKð0 ðOØ;ðOà	óOó ðOô4ôôô"@ô:ð
Ø4ð
à	ô
ô:
ô#
ôJ
ð(!àEð!ð ð!ð 
ô	!ð6 ð.à)ð.ð ð.ð 
õ	.ð2 ð.à)ð.ð ð.ð 
õ	.ð0
Ø/ð
à	ô
ð
Ø-ð
à	÷
r�   rq   c                  ó<  • \ rS rSr% \" 5       rS\S'    SV     SWS jjrSXS jrSYS jr	SZS jr
S[S	 jrS\S
 jr SV     S]S jjrS^S jrS_S jrS`S jrSaS jrS^S jrSbS jrS^S jrScSdS jjr\rScSdS jjrSVSeS jjr\r  Sf       SgS jjrShS jrSiS jrSjS jrSkS jrSlS jrSkS jr S^S jr!SmS jr"SnS jr#SoS  jr$SlS! jr%SpS" jr&SkS# jr'SlS$ jr(SkS% jr)SqS& jr*SrS' jr+SsS( jr,StS) jr-SuS* jr.S^S+ jr/SvS, jr0SwS- jr1S\S. jr2S\S/ jr3S\S0 jr4 SV       SxS1 jjr5SyS2 jr6\7Rp                      SzS3 j5       r9\7Rp                  S4S5.   S{S6 jj5       r9S4S5.   S|S7 jjr9\7Rp                      SzS8 j5       r:\7Rp                  S4S5.   S{S9 jj5       r:S4S5.   S|S: jjr:\;S}S; j5       r<\;    S~S< j5       r=\7Rp                      SS= j5       r>\7Rp                  S4S5.   S€S> jj5       r>S4S5.   S�S? jjr>\7Rp                      SS@ j5       r?\7Rp                  S4S5.   S€SA jj5       r?S4S5.   S�SB jjr?SkSC jr@SkSD jrASlSE jrBSlSF jrCS‚SG jrDSƒSH jrE    S„SI jrFS\SJ jrGS\SK jrHS…SL jrISpSM jrJS…SN jrKS†SO jrLS^SP jrMS‡SQ jrNSwSR jrOSwSS jrPSlST jrQSUrRg)ˆrp   iP  z&typing.MutableMapping[Any, Connection]r9  Nc                ó”  • [        U[        5      (       d  [        S5      e[        R                  " UR
                  5      n[        R                  " U[        R                  5      U l	        [        R                  " U R                  [        R                  5        Xl        SU l        SU l        UR                  U l        UR                  U l        UR                   U l        UR"                  U l        X R$                  U R                  '   Ucæ  SU l        [        R(                  " [        R*                  " 5       5      U l        [/        U R,                  [        R0                  :g  5        [        R(                  " [        R*                  " 5       5      U l        [/        U R2                  [        R0                  :g  5        [        R4                  " U R                  U R,                  U R2                  5        gSU l        SU l        X l        [        R6                  " U R                  [9        U R&                  5      5      n[/        US:H  5        g)zÊ
Create a new Connection object, using the given OpenSSL.SSL.Context
instance and socket.

:param context: An SSL Context to use for this connection
:param socket: The socket to use for transport layer
ú"context must be a Context instanceNr1  )rW  rq   rY  r¢   ÚSSL_newrÏ  rK  rÍ  ÚSSL_freeÚ_sslÚSSL_set_modeÚSSL_MODE_AUTO_RETRYrØ  r\  rÓ  rÔ  rÞ  rß  r9  Ú_socketÚBIO_newÚ	BIO_s_memÚ	_into_sslrË  ru  Ú	_from_sslÚSSL_set_bioÚ
SSL_set_fdr¯  )r"  rè  ÚsocketrC  r  s        rž   r#  ÚConnection.__init__U  s‹  € ô ˜'¤7×+Ñ+ÜÐ@ÓAÐAä�lŠl˜7×+Ñ+Ó,ˆÜ—G’G˜C¤§¡Ó/ˆŒ	ô
 	×Ò˜$Ÿ)™)¤T×%=Ñ%=Ô>ØŒØˆŒð 04ˆÔ'ð
 &×4Ñ4ˆÔØ '× 8Ñ 8ˆÔð (/×'FÑ'FˆÔ$Ø%,×%BÑ%BˆÔ"à+/×Ñ˜dŸi™iÑ(à‰>ØˆDŒLä!Ÿ\š\¬$¯.ª.Ó*:Ó;ˆDŒNÜ˜DŸN™N¬d¯i©iÑ7Ô8ä!Ÿ\š\¬$¯.ª.Ó*:Ó;ˆDŒNÜ˜DŸN™N¬d¯i©iÑ7Ô8ä×Ò˜TŸY™Y¨¯©¸¿¹ÕGà!ˆDŒNØ!ˆDŒNØ!ŒLÜŸšØ—	‘	Ô,¨T¯\©\Ó:óˆJô ˜J¨!™OÕ,r�   c                ó”   • U R                   c&  [        SU R                  R                   SU S35      e[	        U R                   U5      $ )za
Look up attributes on the wrapped socket object if they are not found
on the Connection object.
Ú'z' object has no attribute ')rT  ÚAttributeErrorÚ	__class__r˜   r™  ©r"  r   s     rž   Ú__getattr__ÚConnection.__getattr__‘  sL   € ð
 �<‰<ÑÜ Ø�D—N‘N×+Ñ+Ð,Ð,GÈÀvÈQÐOóð ô ˜4Ÿ<™<¨Ó.Ð.r�   c                ó|  • U R                   R                  b$  U R                   R                  R                  5         U R                   R                  b$  U R                   R                  R                  5         U R                   R                  b$  U R                   R                  R                  5         [
        R                  " X5      nU[
        R                  :X  a
  [        5       eU[
        R                  :X  a
  [        5       eU[
        R                  :X  a
  [        5       eU[
        R                  :X  a
  [        5       eU[
        R                  :X  a•  [         S:X  a  ["        R$                  " 5       S   nO["        R&                  n[
        R(                  " 5       S:X  d  US:w  a8  US:  a&  US:w  a   [+        U[,        R.                  " U5      5      e[+        SS5      e[1        5         g U[
        R2                  :X  a¡  [
        R(                  " 5       S:w  aˆ  [
        R(                  " 5       n[
        R4                  " U5      n[
        R6                  (       a=  [9        U[
        R:                  :H  5        [
        R<                  " 5         [+        SS5      e[1        5         g U[
        R>                  :X  a  g [1        5         g )NÚwin32r   r†  zUnexpected EOF) rÏ  rÓ  r(  rÙ  rÛ  r¢   ÚSSL_get_errorÚSSL_ERROR_WANT_READr€   ÚSSL_ERROR_WANT_WRITEr�   ÚSSL_ERROR_ZERO_RETURNr„   ÚSSL_ERROR_WANT_X509_LOOKUPr‚   ÚSSL_ERROR_SYSCALLr
   rK  ÚgetwinerrorÚerrnoÚERR_peek_errorr|   r   r"  r&  ÚSSL_ERROR_SSLÚERR_GET_REASONÚ-Cryptography_HAS_UNEXPECTED_EOF_WHILE_READINGrË  Ú"SSL_R_UNEXPECTED_EOF_WHILE_READINGÚERR_clear_errorÚSSL_ERROR_NONE)r"  rC  rE  r»  rm  Úpeeked_errorÚreasons          rž   Ú_raise_ssl_errorÚConnection._raise_ssl_error�  s÷  € Ø�=‰=×'Ñ'Ñ3Ø�M‰M×(Ñ(×9Ñ9Ô;Ø�=‰=×,Ñ,Ñ8Ø�M‰M×-Ñ-×>Ñ>Ô@Ø�=‰=×%Ñ%Ñ1Ø�M‰M×&Ñ&×7Ñ7Ô9ä×"Ò" 3Ó/ˆØ”D×,Ñ,Ó,Ü“/Ð!Ø”d×/Ñ/Ó/Ü Ó"Ð"Ø”d×0Ñ0Ó0Ü!Ó#Ð#Ø”d×5Ñ5Ó5ä%Ó'Ð'Ø”d×,Ñ,Ó,Ü˜7Ó"Ü×(Ò(Ó*¨1Ñ-‘äŸ
™
�Ü×"Ò"Ó$¨Ó)¨U°a«ZØ˜A“: %¨1£*Ü& u¬i¯mªm¸EÓ.BÓCÐCÜ" 2Ð'7Ó8Ð8ô %Õ&Ø”d×(Ñ(Ó(¬T×-@Ò-@Ó-BÀaÓ-Gô  ×.Ò.Ó0ˆLÜ×(Ò(¨Ó6ˆFÜ×A×AÜØœd×EÑEÑEôô ×$Ò$Ô&Ü" 2Ð'7Ó8Ð8ä$Õ&Ø”d×)Ñ)Ó)Øä Õ"r�   c                ó   • U R                   $ )zP
Retrieve the :class:`Context` object associated with this
:class:`Connection`.
)rÏ  r!  s    rž   Úget_contextÚConnection.get_contextÒ  s   € ð
 �}‰}Ðr�   c                ó¦   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  UR                  5        Xl        g)zŠ
Switch this connection to a new session context.

:param context: A :class:`Context` instance giving the new session
    context to use.
rN  N)rW  rq   rY  r¢   ÚSSL_set_SSL_CTXrQ  rÏ  )r"  rè  s     rž   Úset_contextÚConnection.set_contextÙ  s<   € ô ˜'¤7×+Ñ+ÜÐ@ÓAÐAä×Ò˜TŸY™Y¨×(8Ñ(8Ô9Ø�r�   c                ó¶   • [         R                  " U R                  [         R                  5      nU[        R
                  :X  a  g[        R                  " U5      $ )zÇ
Retrieve the servername extension value if provided in the client hello
message, or None if there wasn't one.

:return: A byte string giving the server name or :data:`None`.

.. versionadded:: 0.13
N)r¢   ÚSSL_get_servernamerQ  ÚTLSEXT_NAMETYPE_host_namerK  ru  r±  ra  s     rž   Úget_servernameÚConnection.get_servernameæ  sC   € ô ×&Ò&Ø�I‰I”t×5Ñ5ó
ˆð ”4—9‘9ÓØä�{Š{˜4Ó Ð r�   c                óª  • [        U[        5      (       d  [        S5      eUc?  SU l        SU l        [
        R                  " U R                  U[        R                  5        g[        U5      (       d  [        S5      e[        U5      U l        U R                  R                  U l        [
        R                  " U R                  XR                  5        g)z
Override the Context object's verification flags for this specific
connection. See :py:meth:`Context.set_verify` for details.
rp  Nr  )rW  r…   rY  rÓ  rÔ  r¢   ÚSSL_set_verifyrQ  rK  ru  r  r.  rG  r|  s      rž   r}  ÚConnection.set_verify÷  sŸ   € ô ˜$¤×$Ñ$ÜÐ5Ó6Ð6àÑØ"&ˆDÔØ$(ˆDÔ!Ü×Ò §	¡	¨4´·±Õ;ä˜H×%Ñ%ÜÐ ;Ó<Ð<ä"/°Ó"9ˆDÔØ$(×$7Ñ$7×$@Ñ$@ˆDÔ!Ü×Ò §	¡	¨4×1FÑ1FÕGr�   c                óB   • [         R                  " U R                  5      $ )zg
Retrieve the Connection object's verify mode, as set by
:meth:`set_verify`.

:return: The verify mode
)r¢   ÚSSL_get_verify_moderQ  r!  s    rž   r†  ÚConnection.get_verify_mode  s   € ô ×'Ò'¨¯	©	Ó2Ð2r�   c                ó
  • [        U[        5      (       d  [        R                  " U5      nO[        R                  " S[
        SS9  [        R                  " U R                  UR                  5      nU(       d  [        5         ggr8  )rW  r   r<  r=  r>  r?  r¢   ÚSSL_use_certificaterQ  rA  r&  rB  s      rž   rC  ÚConnection.use_certificate  se   € ô ˜$¤×%Ñ%Ü×)Ò)¨$Ó/‰Dä�MŠMðJô #Øòô ×-Ò-¨d¯i©i¸¿¹ÓDˆ
ÞÜ Õ"ð r�   c                ó*  • [        U[        5      (       d  [        R                  " U5      nO[        R                  " S[
        SS9  [        R                  " U R                  UR                  5      nU(       d  U R                  R                  5         ggrW  )rW  r   rX  r=  r>  r?  r¢   ÚSSL_use_PrivateKeyrQ  rZ  rÏ  rO  r[  s      rž   r]  ÚConnection.use_privatekey.  so   € ô ˜$¤×%Ñ%Ü×-Ò-¨dÓ3‰Dä�MŠMðEô #Øòô ×,Ò,¨T¯Y©Y¸¿
¹
ÓCˆ
ÞØ�M‰M×5Ñ5Õ7ð r�   c                óF   • [         R                  " U R                  U5        g)a  
For DTLS, set the maximum UDP payload size (*not* including IP/UDP
overhead).

Note that you might have to set :data:`OP_NO_QUERY_MTU` to prevent
OpenSSL from spontaneously clearing this.

:param mtu: An integer giving the maximum transmission unit.

.. versionadded:: 21.1
N)r¢   ÚSSL_set_mturQ  )r"  Úmtus     rž   Úset_ciphertext_mtuÚConnection.set_ciphertext_mtuF  s   € ô 	×Ò˜Ÿ™ CÕ(r�   c                ó‚   • [        [        S5      (       d  [        S5      e[        R                  " U R                  5      $ )zÚ
For DTLS, get the maximum size of unencrypted data you can pass to
:meth:`write` without exceeding the MTU (as passed to
:meth:`set_ciphertext_mtu`).

:return: The effective MTU as an integer.

.. versionadded:: 21.1
ÚDTLS_get_data_mtuz requires OpenSSL 1.1.1 or better)Úhasattrr¢   r¸  r—  rQ  r!  s    rž   Úget_cleartext_mtuÚConnection.get_cleartext_mtuT  s3   € ô ”tÐ0×1Ñ1Ü%Ð&HÓIÐIÜ×%Ò% d§i¡iÓ0Ð0r�   c                ó¨   • [        U[        5      (       d  [        S5      eSU;   a  [        S5      e[        R                  " U R
                  U5        g)z�
Set the value of the servername extension to send in the client hello.

:param name: A byte string giving the name.

.. versionadded:: 0.13
zname must be a byte stringó    zname must not contain NUL byteN)rW  rX  rY  r¢   ÚSSL_set_tlsext_host_namerQ  ra  s     rž   Úset_tlsext_host_nameÚConnection.set_tlsext_host_namec  sF   € ô ˜$¤×&Ñ&ÜÐ8Ó9Ð9Ø�d‹]ÜÐ<Ó=Ð=ô 	×%Ò% d§i¡i°Õ6r�   c                óB   • [         R                  " U R                  5      $ )z¯
Get the number of bytes that can be safely read from the SSL buffer
(**not** the underlying transport buffer).

:return: The number of bytes available in the receive buffer.
)r¢   ÚSSL_pendingrQ  r!  s    rž   ÚpendingÚConnection.pendings  s   € ô ×Ò §	¡	Ó*Ð*r�   c                óB  • [        SU5      n[        R                  " U5       n[        U5      S:”  a  [	        S5      e[
        R                  " U R                  U[        U5      5      nU R                  U R                  U5        UsSSS5        $ ! , (       d  f       g= f)as  
Send data on the connection. NOTE: If you get one of the WantRead,
WantWrite or WantX509Lookup exceptions on this, you have to call the
method again with the SAME buffer.

:param buf: The string, buffer or memoryview to send
:param flags: (optional) Included for compatibility with the socket
              API, the value is ignored
:return: The number of bytes written
rk  éÿÿÿz,Cannot send more than 2**31-1 bytes at once.N)	re  rK  Úfrom_bufferr[  r•  r¢   Ú	SSL_writerQ  rw  )r"  rk  Úflagsrz  rE  s        rž   ÚsendÚConnection.send|  s{   € ô & e¨SÓ1ˆä×Ò˜cÔ" dä�3‹x˜*Ó$Ü ØBóð ô —^’^ D§I¡I¨t´S¸³YÓ?ˆFØ×!Ñ! $§)¡)¨VÔ4à÷ #×"×"ús   £A#BÂ
Bc           	     ó^  • [        SU5      n[        R                  " U5       n[        U5      nSnU(       a[  [        R
                  " U R                  X5-   [        US5      5      nU R                  U R                  U5        XV-  nXF-  nU(       a  M[  UsSSS5        $ ! , (       d  f       g= f)ai  
Send "all" data on the connection. This calls send() repeatedly until
all data is sent. If an error occurs, it's impossible to tell how much
data has been sent.

:param buf: The string, buffer or memoryview to send
:param flags: (optional) Included for compatibility with the socket
              API, the value is ignored
:return: The number of bytes written
rk  r   r¥  N)	re  rK  r¦  r[  r¢   r§  rQ  Úminrw  )r"  rk  r¨  rz  Úleft_to_sendÚ
total_sentrE  s          rž   ÚsendallÚConnection.sendall˜  s”   € ô & e¨SÓ1ˆä×Ò˜cÔ" dÜ˜s›8ˆLØˆJæô ŸšØ—I‘I˜tÑ0´#°lÀJÓ2Oó�ð ×%Ñ% d§i¡i°Ô8ØÑ$�
ØÑ&�÷ �,ð ÷ #×"×"ús   £A.BÂBÂ
B,c                ó@  • [        SU5      nUb:  U[        R                  -  (       a"  [        R                  " U R
                  X15      nO![        R                  " U R
                  X15      nU R                  U R
                  U5        [        R                  " X45      SS $ )zå
Receive data on the connection.

:param bufsiz: The maximum number of bytes to read
:param flags: (optional) The only supported flag is ``MSG_PEEK``,
    all other flags are ignored.
:return: The string read from the Connection
úchar[]N)
Ú_no_zero_allocatorr[  ÚMSG_PEEKr¢   ÚSSL_peekrQ  ÚSSL_readrw  rK  rV  )r"  Úbufsizr¨  rk  rE  s        rž   ÚrecvÚConnection.recvµ  sq   € ô ! ¨6Ó2ˆØÑ ¬¯©×!8Ü—]’] 4§9¡9¨cÓ:‰Fä—]’] 4§9¡9¨cÓ:ˆFØ×Ñ˜dŸi™i¨Ô0Ü�{Š{˜3Ó'©Ð*Ð*r�   c                óž  • Uc  [        U5      nO[        U[        U5      5      n[        SU5      nUb:  U[        R                  -  (       a"  [
        R                  " U R                  XB5      nO![
        R                  " U R                  XB5      nU R                  U R                  U5        [        [        R                  " XE5      5      USU& U$ )a  
Receive data on the connection and copy it directly into the provided
buffer, rather than creating a new string.

:param buffer: The buffer to copy into.
:param nbytes: (optional) The maximum number of bytes to read into the
    buffer. If not present, defaults to the size of the buffer. If
    larger than the size of the buffer, is reduced to the size of the
    buffer.
:param flags: (optional) The only supported flag is ``MSG_PEEK``,
    all other flags are ignored.
:return: The number of bytes read into the buffer.
Nr²  )r[  r¬  r³  r[  r´  r¢   rµ  rQ  r¶  rw  Ú
memoryviewrK  rV  )r"  rV  Únbytesr¨  rk  rE  s         rž   Ú	recv_intoÚConnection.recv_intoÈ  s�   € ð& ‰>Ü˜“[‰Fä˜¤ V£Ó-ˆFô
 ! ¨6Ó2ˆØÑ ¬¯©×!8Ü—]’] 4§9¡9¨cÓ:‰Fä—]’] 4§9¡9¨cÓ:ˆFØ×Ñ˜dŸi™i¨Ô0ô %¤T§[¢[°Ó%=Ó>ˆˆw�ˆàˆr�   c                óD  • [         R                  " U5      (       a{  [         R                  " U5      (       a
  [        5       e[         R                  " U5      (       a
  [        5       e[         R                  " U5      (       a  [        S5      e[        S5      e[        5         g )NÚBIO_should_io_specialzunknown bio failure)	r¢   ÚBIO_should_retryÚBIO_should_readr€   ÚBIO_should_writer�   rÀ  r•  r&  )r"  r”  rE  s      rž   Ú_handle_bio_errorsÚConnection._handle_bio_errorsò  s{   € Ü× Ò  ×%Ñ%Ü×#Ò# C×(Ñ(Ü#“oÐ%Ü×&Ò& s×+Ñ+ä$Ó&Ð&Ü×+Ò+¨C×0Ñ0ô !Ð!8Ó9Ð9ô !Ð!6Ó7Ð7ô !Õ"r�   c                óB  • U R                   c  [        S5      e[        U[        5      (       d  [        S5      e[	        SU5      n[
        R                  " U R                   X!5      nUS::  a  U R                  U R                   U5        [        R                  " X#5      SS $ )ay  
If the Connection was created with a memory BIO, this method can be
used to read bytes from the write end of that memory BIO.  Many
Connection methods will add bytes which must be read in this manner or
the buffer will eventually fill up and the Connection will be able to
take no further actions.

:param bufsiz: The maximum number of bytes to read
:return: The string read.
NúConnection sock was not Nonezbufsiz must be an integerr²  r   )
rX  rY  rW  r…   r³  r¢   ÚBIO_readrÄ  rK  rV  )r"  r·  rk  rE  s       rž   Úbio_readÚConnection.bio_read	  s‚   € ð �>‰>Ñ!ÜÐ:Ó;Ð;ä˜&¤#×&Ñ&ÜÐ7Ó8Ð8ä  ¨6Ó2ˆÜ—’˜tŸ~™~¨sÓ;ˆØ�Q‹;Ø×#Ñ# D§N¡N°FÔ;ä�{Š{˜3Ó'©Ð*Ð*r�   c                óJ  • [        SU5      nU R                  c  [        S5      e[        R                  " U5       n[
        R                  " U R                  U[        U5      5      nUS::  a  U R                  U R                  U5        UsSSS5        $ ! , (       d  f       g= f)a2  
If the Connection was created with a memory BIO, this method can be
used to add bytes to the read end of that memory BIO.  The Connection
can then read the bytes (for example, in response to a call to
:meth:`recv`).

:param buf: The string to put into the memory BIO.
:return: The number of bytes written
rk  NrÇ  r   )	re  rW  rY  rK  r¦  r¢   Ú	BIO_writer[  rÄ  )r"  rk  rz  rE  s       rž   Ú	bio_writeÚConnection.bio_write	  sz   € ô & e¨SÓ1ˆà�>‰>Ñ!ÜÐ:Ó;Ð;ä×Ò˜cÔ" dÜ—^’^ D§N¡N°D¼#¸d»)ÓDˆFØ˜‹{Ø×'Ñ'¨¯©¸Ô?Ø÷	 #×"×"ús   »ABÂ
B"c                óˆ   • U R                  5       (       d-  [        [        R                  " U R                  5      S:H  5        gg)z^
Renegotiate the session.

:return: True if the renegotiation can be started, False otherwise
r1  TF)Úrenegotiate_pendingrË  r¢   ÚSSL_renegotiaterQ  r!  s    rž   ÚrenegotiateÚConnection.renegotiate1	  s5   € ð ×'Ñ'×)Ñ)ÜœD×0Ò0°·±Ó;¸qÑ@ÔAØØr�   c                ó|   • [         R                  " U R                  5      nU R                  U R                  U5        g)zÛ
Perform an SSL handshake (usually called after :meth:`renegotiate` or
one of :meth:`set_accept_state` or :meth:`set_connect_state`). This can
raise the same exceptions as :meth:`send` and :meth:`recv`.

:return: None.
N)r¢   ÚSSL_do_handshakerQ  rw  ©r"  rE  s     rž   Údo_handshakeÚConnection.do_handshake<	  s,   € ô ×&Ò& t§y¡yÓ1ˆØ×Ñ˜dŸi™i¨Õ0r�   c                óH   • [         R                  " U R                  5      S:H  $ )zœ
Check if there's a renegotiation in progress, it will return False once
a renegotiation is finished.

:return: Whether there's a renegotiation in progress
r1  )r¢   ÚSSL_renegotiate_pendingrQ  r!  s    rž   rÐ  ÚConnection.renegotiate_pendingG	  s   € ô ×+Ò+¨D¯I©IÓ6¸!Ñ;Ð;r�   c                óB   • [         R                  " U R                  5      $ )zV
Find out the total number of renegotiations.

:return: The number of renegotiations.
)r¢   ÚSSL_total_renegotiationsrQ  r!  s    rž   Útotal_renegotiationsÚConnection.total_renegotiationsP	  s   € ô ×,Ò,¨T¯Y©YÓ7Ð7r�   c                óx   • [         R                  " U R                  5        U R                  R	                  U5      $ )a  
Call the :meth:`connect` method of the underlying socket and set up SSL
on the socket, using the :class:`Context` object supplied to this
:class:`Connection` object at creation.

:param addr: A remote address
:return: What the socket's connect method returns
)r¢   ÚSSL_set_connect_staterQ  rT  Úconnect)r"  Úaddrs     rž   râ  ÚConnection.connectX	  s+   € ô 	×"Ò" 4§9¡9Ô-Ø�|‰|×#Ñ# DÓ)Ð)r�   c                ó^   • U R                   R                  nU R                  5         U" U5      $ )a]  
Call the :meth:`connect_ex` method of the underlying socket and set up
SSL on the socket, using the Context object supplied to this Connection
object at creation. Note that if the :meth:`connect_ex` method of the
socket doesn't return 0, SSL won't be initialized.

:param addr: A remove address
:return: What the socket's connect_ex method returns
)rT  Ú
connect_exÚset_connect_state)r"  rã  ræ  s      rž   ræ  ÚConnection.connect_exd	  s*   € ð —\‘\×,Ñ,ˆ
Ø×ÑÔ Ù˜$ÓÐr�   c                óŒ   • U R                   R                  5       u  p[        U R                  U5      nUR	                  5         X24$ )aS  
Call the :meth:`accept` method of the underlying socket and set up SSL
on the returned socket, using the Context object supplied to this
:class:`Connection` object at creation.

:return: A *(conn, addr)* pair where *conn* is the new
    :class:`Connection` object created, and *address* is as returned by
    the socket's :meth:`accept`.
)rT  Úacceptrp   rÏ  Úset_accept_state)r"  Úclientrã  re  s       rž   rê  ÚConnection.acceptr	  s<   € ð —|‘|×*Ñ*Ó,‰ˆÜ˜$Ÿ-™-¨Ó0ˆØ×ÑÔØˆ|Ðr�   c                óÖ  • [         R                  " 5       n [         R                  " U R                  U5      n[         R                  " U5        U R
                  b  U R
                  R                  5         U R                  b  U R                  R                  5         US:X  a
  [        5       eUS:  a  U R                  U R                  U5        gg! [         R                  " U5        f = f)zu
Call the OpenSSL function DTLSv1_listen on this connection. See the
OpenSSL manual for more details.

:return: None
Nr   )
r¢   ÚBIO_ADDR_newÚDTLSv1_listenrQ  ÚBIO_ADDR_freerÞ  r(  rß  r€   rw  )r"  Úbio_addrrE  s      rž   rð  ÚConnection.DTLSv1_listen�	  sº   € ô ×$Ò$Ó&ˆð	)Ü×'Ò'¨¯	©	°8Ó<ˆFä×Ò˜xÔ(ð
 ×'Ñ'Ñ3Ø×(Ñ(×9Ñ9Ô;Ø×%Ñ%Ñ1Ø×&Ñ&×7Ñ7Ô9Ø�Q‹;Ü“/Ð!Ø�A‹:Ø×!Ñ! $§)¡)¨VÕ4ð øô ×Ò˜xÕ(ús   —!C ÃC(c                óÄ   • [         R                  " S5      n[         R                  " S5      n[        R                  " U R                  X5      (       a  US   US   S-  -   $ g)aE  
Determine when the DTLS SSL object next needs to perform internal
processing due to the passage of time.

When the returned number of seconds have passed, the
:meth:`DTLSv1_handle_timeout` method needs to be called.

:return: The time left in seconds before the next timeout or `None`
    if no timeout is currently active.
ztime_t *zlong *r   i@B N)rK  rZ  r¢   ÚCryptography_DTLSv1_get_timeoutrQ  )r"  Úptv_secÚptv_usecs      rž   ÚDTLSv1_get_timeoutÚConnection.DTLSv1_get_timeout›	  sR   € ô —(’(˜:Ó&ˆÜ—8’8˜HÓ%ˆÜ×/Ò/°·	±	¸7×MÑMØ˜1‘: ¨!¡¨wÑ!6Ñ7Ð7àr�   c                óª   • [         R                  " U R                  5      nUS:  a#  U R                  U R                  U5         S5       e[	        U5      $ )z�
Handles any timeout events which have become pending on a DTLS SSL
object.

:return: `True` if there was a pending timeout, `False` otherwise.
r   Úunreachable)r¢   ÚDTLSv1_handle_timeoutrQ  rw  rˆ  rÖ  s     rž   rü  Ú Connection.DTLSv1_handle_timeout­	  sG   € ô ×+Ò+¨D¯I©IÓ6ˆØ�A‹:Ø×!Ñ! $§)¡)¨VÔ4Ø'˜-Ó'�5ä˜“<Ðr�   c                óv   • U R                   c  [        S5      e[        R                  " U R                  S5        g)z­
If the Connection was created with a memory BIO, this method can be
used to indicate that *end of file* has been reached on the read end of
that memory BIO.

:return: None
NrÇ  r   )rX  rY  r¢   ÚBIO_set_mem_eof_returnrW  r!  s    rž   Úbio_shutdownÚConnection.bio_shutdown»	  s.   € ð �>‰>Ñ!ÜÐ:Ó;Ð;ä×#Ò# D§N¡N°AÕ6r�   c                ó¤   • [         R                  " U R                  5      nUS:  a#  U R                  U R                  U5         S5       eUS:”  a  gg)a!  
Send the shutdown message to the Connection.

:return: True if the shutdown completed successfully (i.e. both sides
         have sent closure alerts), False otherwise (in which case you
         call :meth:`recv` or :meth:`send` when the connection becomes
         readable/writeable).
r   Frû  T)r¢   ÚSSL_shutdownrQ  rw  rÖ  s     rž   ÚshutdownÚConnection.shutdownÈ	  sJ   € ô ×"Ò" 4§9¡9Ó-ˆØ�A‹:Ø×!Ñ! $§)¡)¨VÔ4Ø'˜-Ó'�5Ø�a‹ZØàr�   c                ó  • / n[        5        Ho  n[        R                  " U R                  U5      nU[        R
                  :X  a    U$ UR                  [        R                  " U5      R                  S5      5        Mq     U$ )zh
Retrieve the list of ciphers used by the Connection object.

:return: A list of native cipher strings.
úutf-8)	r	   r¢   ÚSSL_get_cipher_listrQ  rK  ru  r<  r±  r  )r"  Úciphersr«  rE  s       rž   r°  ÚConnection.get_cipher_listÚ	  sh   € ð ˆÜ–ˆAÜ×-Ò-¨d¯i©i¸Ó;ˆFØœŸ™Ó"Øàˆð �N‰Nœ4Ÿ;š; vÓ.×5Ñ5°gÓ>Ö?ñ	 ð
 ˆr�   c                óü  • [         R                  " U R                  5      nU[        R                  :X  a  / $ / n[        [         R                  " U5      5       H   n[         R                  " X5      n[         R                  " U5      n[        U[        R                  :g  5        [        R                  " [        5      n[        R                  " U[         R                  5      Ul        UR                  U5        M¢     U$ )a˜  
Get CAs whose certificates are suggested for client authentication.

:return: If this is a server connection, the list of certificate
    authorities that will be sent or has been sent to the client, as
    controlled by this :class:`Connection`'s :class:`Context`.

    If this is a client connection, the list will be empty until the
    connection with the server is established.

.. versionadded:: 0.10
)r¢   ÚSSL_get_client_CA_listrQ  rK  ru  ÚrangeÚsk_X509_NAME_numÚsk_X509_NAME_valuer¶  rË  r   rê  rÍ  r¹  r·  r<  )r"  Úca_namesrE  r«  r   rJ  Úpynames          rž   Úget_client_ca_listÚConnection.get_client_ca_listè	  s´   € ô ×.Ò.¨t¯y©yÓ9ˆØ”t—y‘yÓ àˆIàˆÜ”t×,Ò,¨XÓ6Ö7ˆAÜ×*Ò*¨8Ó7ˆDÜ×%Ò% dÓ+ˆDÜ˜D¤D§I¡IÑ-Ô.ä×%Ò%¤hÓ/ˆFÜŸ7š7 4¬×)<Ñ)<Ó=ˆFŒLØ�M‰M˜&Ö!ñ 8ð ˆr�   c                ó   • [        S5      e)z|
The makefile() method is not implemented, since there is no dup
semantics for SSL connections

:raise: NotImplementedError
z1Cannot make file object of OpenSSL.SSL.Connectionr·  ©r"  r¹  rº  s      rž   ÚmakefileÚConnection.makefile
  s   € ô "Ø?ó
ð 	
r�   c                ó   • U R                   $ )zZ
Retrieve application data as set by :meth:`set_app_data`.

:return: The application data
rß  r!  s    rž   rà  ÚConnection.get_app_data
  râ  r�   c                ó   • Xl         g)zG
Set application data

:param data: The application data
:return: None
Nrß  rä  s     rž   rå  ÚConnection.set_app_data
  rç  r�   c                óB   • [         R                  " U R                  5      $ )z~
Get the shutdown state of the Connection.

:return: The shutdown state, a bitvector of SENT_SHUTDOWN,
    RECEIVED_SHUTDOWN.
)r¢   ÚSSL_get_shutdownrQ  r!  s    rž   Úget_shutdownÚConnection.get_shutdown!
  s   € ô ×$Ò$ T§Y¡YÓ/Ð/r�   c                ó†   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  U5        g)zw
Set the shutdown state of the Connection.

:param state: bitvector of SENT_SHUTDOWN, RECEIVED_SHUTDOWN.
:return: None
zstate must be an integerN)rW  r…   rY  r¢   ÚSSL_set_shutdownrQ  )r"  Ústates     rž   Úset_shutdownÚConnection.set_shutdown*
  s1   € ô ˜%¤×%Ñ%ÜÐ6Ó7Ð7ä×Ò˜dŸi™i¨Õ/r�   c                ój   • [         R                  " [        R                  " U R                  5      5      $ )zl
Retrieve a verbose string detailing the state of the Connection.

:return: A string representing the state
)rK  r±  r¢   ÚSSL_state_string_longrQ  r!  s    rž   Úget_state_stringÚConnection.get_state_string6
  s"   € ô �{Š{œ4×5Ò5°d·i±iÓ@ÓAÐAr�   c                ót  • [         R                  " U R                  5      nU[        R                  :X  a  g[         R
                  " U R                  [        R                  S5      n[        US:„  5        [        SU5      n[         R
                  " U R                  X25        [        R                  " X25      SS $ )zi
Retrieve the random value used with the server hello message.

:return: A string representing the state
Nr   rU  )	r¢   ÚSSL_get_sessionrQ  rK  ru  ÚSSL_get_server_randomrË  r³  rV  ©r"  ÚsessionÚlengthÚoutps       rž   Úserver_randomÚConnection.server_random>
  s„   € ô ×&Ò& t§y¡yÓ1ˆØ”d—i‘iÓØÜ×+Ò+¨D¯I©I´t·y±yÀ!ÓDˆÜ˜ ™
Ô#Ü!Ð"3°VÓ<ˆÜ×"Ò" 4§9¡9¨dÔ;Ü�{Š{˜4Ó(©Ð+Ð+r�   c                ót  • [         R                  " U R                  5      nU[        R                  :X  a  g[         R
                  " U R                  [        R                  S5      n[        US:„  5        [        SU5      n[         R
                  " U R                  X25        [        R                  " X25      SS $ )zi
Retrieve the random value used with the client hello message.

:return: A string representing the state
Nr   rU  )	r¢   r*  rQ  rK  ru  ÚSSL_get_client_randomrË  r³  rV  r,  s       rž   Úclient_randomÚConnection.client_randomM
  s„   € ô ×&Ò& t§y¡yÓ1ˆØ”d—i‘iÓØä×+Ò+¨D¯I©I´t·y±yÀ!ÓDˆÜ˜ ™
Ô#Ü!Ð"3°VÓ<ˆÜ×"Ò" 4§9¡9¨dÔ;Ü�{Š{˜4Ó(©Ð+Ð+r�   c                óL  • [         R                  " U R                  5      nU[        R                  :X  a  g[         R
                  " U[        R                  S5      n[        US:„  5        [        SU5      n[         R
                  " XU5        [        R                  " X25      SS $ )zb
Retrieve the value of the master key for this session.

:return: A string representing the state
Nr   rU  )	r¢   r*  rQ  rK  ru  ÚSSL_SESSION_get_master_keyrË  r³  rV  r,  s       rž   Ú
master_keyÚConnection.master_key]
  s|   € ô ×&Ò& t§y¡yÓ1ˆØ”d—i‘iÓØä×0Ò0°¼$¿)¹)ÀQÓGˆÜ˜ ™
Ô#Ü!Ð"3°VÓ<ˆÜ×'Ò'¨°vÔ>Ü�{Š{˜4Ó(©Ð+Ð+r�   c           
     ó  • [        SU5      n[        R                  nSnSnUb  Un[        U5      nSn[        R
                  " U R                  UUU[        U5      UUU5      n[        US:H  5        [        R                  " XB5      SS $ )a  
Obtain keying material for application use.

:param: label - a disambiguating label string as described in RFC 5705
:param: olen - the length of the exported key material in bytes
:param: context - a per-association context value
:return: the exported key material bytes or None
rU  r   Nr1  )	r³  rK  ru  r[  r¢   ÚSSL_export_keying_materialrQ  rË  rV  )	r"  ÚlabelÚolenrè  r/  Úcontext_bufÚcontext_lenÚuse_contextÚsuccesss	            rž   Úexport_keying_materialÚ!Connection.export_keying_materialm
  s�   € ô "Ð"3°TÓ:ˆÜ—i‘iˆØˆØˆØÑØ!ˆKÜ˜g›,ˆKØˆKÜ×1Ò1Ø�I‰IØØØÜ�‹JØØØó	
ˆô 	˜ 1™Ô%Ü�{Š{˜4Ó&¡qÐ)Ð)r�   c                ó:   • U R                   R                  " U0 UD6$ )zŽ
Call the :meth:`shutdown` method of the underlying socket.
See :manpage:`shutdown(2)`.

:return: What the socket's shutdown() method returns
)rT  r  r  s      rž   Úsock_shutdownÚConnection.sock_shutdown�
  s   € ð �|‰|×$Ò$ dÐ5¨fÑ5Ð5r�   c               ó   • g r  r–   ©r"  Úas_cryptographys     rž   Úget_certificateÚConnection.get_certificate–
  ó   € ð 	r�   F)rI  c               ó   • g r  r–   rH  s     rž   rJ  rK  œ
  rL  r�   c               óö   • [         R                  " U R                  5      nU[        R                  :w  aE  [         R
                  " U5        [        R                  " U5      nU(       a  UR                  5       $ U$ g)zÝ
Retrieve the local certificate (if any)

:param bool as_cryptography: Controls whether a
    ``cryptography.x509.Certificate`` or an ``OpenSSL.crypto.X509``
    object should be returned.

:return: The local certificate
N)	r¢   ÚSSL_get_certificaterQ  rK  ru  r3  r   r4  Úto_cryptography©r"  rI  r?  Úpycerts       rž   rJ  rK  ¢
  s\   € ô ×'Ò'¨¯	©	Ó2ˆØ”4—9‘9ÓÜ×Ò˜TÔ"Ü×,Ò,¨TÓ2ˆFÞØ×-Ñ-Ó/Ð/ØˆMØr�   c               ó   • g r  r–   rH  s     rž   Úget_peer_certificateÚConnection.get_peer_certificate¹
  rL  r�   c               ó   • g r  r–   rH  s     rž   rT  rU  ¿
  rL  r�   c               óÊ   • [         R                  " U R                  5      nU[        R                  :w  a/  [
        R                  " U5      nU(       a  UR                  5       $ U$ g)zå
Retrieve the other side's certificate (if any)

:param bool as_cryptography: Controls whether a
    ``cryptography.x509.Certificate`` or an ``OpenSSL.crypto.X509``
    object should be returned.

:return: The peer's certificate
N)r¢   ÚSSL_get_peer_certificaterQ  rK  ru  r   r4  rP  rQ  s       rž   rT  rU  Å
  sN   € ô ×,Ò,¨T¯Y©YÓ7ˆØ”4—9‘9ÓÜ×,Ò,¨TÓ2ˆFÞØ×-Ñ-Ó/Ð/ØˆMØr�   c                óP  • / n[        [        R                  " U 5      5       H€  n[        R                  " X5      n[	        U[
        R                  :g  5        [        R                  " U5      n[	        US:¬  5        [        R                  " U5      nUR                  U5        M‚     U$ ©zJ
Internal helper to convert a STACK_OF(X509) to a list of X509
instances.
r1  )r  r¢   Úsk_X509_numÚsk_X509_valuerË  rK  ru  r3  r   r4  r<  ©Ú
cert_stackrE  r«  r?  r–  rR  s         rž   Ú_cert_stack_to_listÚConnection._cert_stack_to_listÛ
  sƒ   € ð ˆÜ”t×'Ò'¨
Ó3Ö4ˆAÜ×%Ò% jÓ4ˆDÜ˜D¤D§I¡IÑ-Ô.Ü×"Ò" 4Ó(ˆCÜ˜C 1™HÔ%Ü×,Ò,¨TÓ2ˆFØ�M‰M˜&Ö!ñ 5ð ˆr�   c                ól  • / n[        [        R                  " U 5      5       HŽ  n[        R                  " X5      n[	        U[
        R                  :g  5        [        R                  " U5      n[	        US:¬  5        [        R                  " U5      nUR                  UR                  5       5        M�     U$ rZ  )r  r¢   r[  r\  rË  rK  ru  r3  r   r4  r<  rP  r]  s         rž   Ú _cert_stack_to_cryptography_listÚ+Connection._cert_stack_to_cryptography_listë
  sŒ   € ð ˆÜ”t×'Ò'¨
Ó3Ö4ˆAÜ×%Ò% jÓ4ˆDÜ˜D¤D§I¡IÑ-Ô.Ü×"Ò" 4Ó(ˆCÜ˜C 1™HÔ%Ü×,Ò,¨TÓ2ˆFØ�M‰M˜&×0Ñ0Ó2Ö3ñ 5ð ˆr�   c               ó   • g r  r–   rH  s     rž   Úget_peer_cert_chainÚConnection.get_peer_cert_chainý
  rL  r�   c               ó   • g r  r–   rH  s     rž   re  rf    rL  r�   c               ó¾   • [         R                  " U R                  5      nU[        R                  :X  a  gU(       a  U R                  U5      $ U R                  U5      $ )a;  
Retrieve the other side's certificate (if any)

:param bool as_cryptography: Controls whether a list of
    ``cryptography.x509.Certificate`` or ``OpenSSL.crypto.X509``
    object should be returned.

:return: A list of X509 instances giving the peer's certificate chain,
         or None if it does not have one.
N)r¢   ÚSSL_get_peer_cert_chainrQ  rK  ru  rb  r_  ©r"  rI  r^  s      rž   re  rf  	  sL   € ô ×1Ò1°$·)±)Ó<ˆ
ØœŸ™Ó"ØæØ×8Ñ8¸ÓDÐDØ×'Ñ'¨
Ó3Ð3r�   c               ó   • g r  r–   rH  s     rž   Úget_verified_chainÚConnection.get_verified_chain   rL  r�   c               ó   • g r  r–   rH  s     rž   rl  rm  &  rL  r�   c               ó¾   • [         R                  " U R                  5      nU[        R                  :X  a  gU(       a  U R                  U5      $ U R                  U5      $ )a*  
Retrieve the verified certificate chain of the peer including the
peer's end entity certificate. It must be called after a session has
been successfully established. If peer verification was not successful
the chain may be incomplete, invalid, or None.

:param bool as_cryptography: Controls whether a list of
    ``cryptography.x509.Certificate`` or ``OpenSSL.crypto.X509``
    object should be returned.

:return: A list of X509 instances giving the peer's verified
         certificate chain, or None if it does not have one.

.. versionadded:: 20.0
N)r¢   ÚSSL_get0_verified_chainrQ  rK  ru  rb  r_  rj  s      rž   rl  rm  ,  sL   € ô* ×1Ò1°$·)±)Ó<ˆ
ØœŸ™Ó"ØæØ×8Ñ8¸ÓDÐDØ×'Ñ'¨
Ó3Ð3r�   c                óB   • [         R                  " U R                  5      $ )zƒ
Checks if more data has to be read from the transport layer to complete
an operation.

:return: True iff more data has to be read
)r¢   ÚSSL_want_readrQ  r!  s    rž   Ú	want_readÚConnection.want_readI  s   € ô ×!Ò! $§)¡)Ó,Ð,r�   c                óB   • [         R                  " U R                  5      $ )z}
Checks if there is data to write to the transport layer to complete an
operation.

:return: True iff there is data to write
)r¢   ÚSSL_want_writerQ  r!  s    rž   Ú
want_writeÚConnection.want_writeR  s   € ô ×"Ò" 4§9¡9Ó-Ð-r�   c                óD   • [         R                  " U R                  5        g)zv
Set the connection to work in server mode. The handshake will be
handled automatically by read/write.

:return: None
N)r¢   ÚSSL_set_accept_staterQ  r!  s    rž   rë  ÚConnection.set_accept_state[  s   € ô 	×!Ò! $§)¡)Õ,r�   c                óD   • [         R                  " U R                  5        g)zv
Set the connection to work in client mode. The handshake will be
handled automatically by read/write.

:return: None
N)r¢   rá  rQ  r!  s    rž   rç  ÚConnection.set_connect_stated  s   € ô 	×"Ò" 4§9¡9Õ-r�   c                óö   • [         R                  " U R                  5      nU[        R                  :X  a  g[
        R                  [
        5      n[        R                  " U[         R                  5      Ul	        U$ )zœ
Returns the Session currently used.

:return: An instance of :class:`OpenSSL.SSL.Session` or
    :obj:`None` if no session exists.

.. versionadded:: 0.14
N)
r¢   ÚSSL_get1_sessionrQ  rK  ru  r{   rê  rÍ  ÚSSL_SESSION_freerÅ  )r"  r-  Ú	pysessions      rž   Úget_sessionÚConnection.get_sessionm  sT   € ô ×'Ò'¨¯	©	Ó2ˆØ”d—i‘iÓØä—O‘O¤GÓ,ˆ	Ü!ŸWšW W¬d×.CÑ.CÓDˆ	ÔØÐr�   c                ó¶   • [        U[        5      (       d  [        S5      e[        R                  " U R
                  UR                  5      n[        US:H  5        g)z´
Set the session to be used when the TLS/SSL connection is established.

:param session: A Session instance representing the session to use.
:returns: None

.. versionadded:: 0.14
z"session must be a Session instancer1  N)rW  r{   rY  r¢   ÚSSL_set_sessionrQ  rÅ  rË  )r"  r-  rE  s      rž   Úset_sessionÚConnection.set_session~  sE   € ô ˜'¤7×+Ñ+ÜÐ@ÓAÐAä×%Ò% d§i¡i°×1AÑ1AÓBˆÜ˜ !™Õ$r�   c                óÖ   • [         R                  " SS5      nU" U R                  US5      nUS:X  a  g[        SU5      nU" U R                  XC5        [         R                  " XC5      SS $ )a  
Helper to implement :meth:`get_finished` and
:meth:`get_peer_finished`.

:param function: Either :data:`SSL_get_finished`: or
    :data:`SSL_get_peer_finished`.

:return: :data:`None` if the desired message has not yet been
    received, otherwise the contents of the message.
r²  r   N)rK  rZ  rQ  r³  rV  )r"  ÚfunctionÚemptyrü  rk  s        rž   Ú_get_finished_messageÚ Connection._get_finished_message�  s^   € ô2 —’˜ 1Ó%ˆÙ˜Ÿ	™	 5¨!Ó,ˆØ�1‹9àä  ¨4Ó0ˆÙ�—‘˜CÔ&Ü�{Š{˜3Ó%¡aÐ(Ð(r�   c                ó@   • U R                  [        R                  5      $ )z³
Obtain the latest TLS Finished message that we sent.

:return: The contents of the message or :obj:`None` if the TLS
    handshake has not yet completed.

.. versionadded:: 0.15
)r‹  r¢   ÚSSL_get_finishedr!  s    rž   Úget_finishedÚConnection.get_finished°  s   € ð ×)Ñ)¬$×*?Ñ*?Ó@Ð@r�   c                ó@   • U R                  [        R                  5      $ )zÅ
Obtain the latest TLS Finished message that we received from the peer.

:return: The contents of the message or :obj:`None` if the TLS
    handshake has not yet completed.

.. versionadded:: 0.15
)r‹  r¢   ÚSSL_get_peer_finishedr!  s    rž   Úget_peer_finishedÚConnection.get_peer_finished»  s   € ð ×)Ñ)¬$×*DÑ*DÓEÐEr�   c                óâ   • [         R                  " U R                  5      nU[        R                  :X  a  g[        R
                  " [         R                  " U5      5      nUR                  S5      $ )z²
Obtain the name of the currently used cipher.

:returns: The name of the currently used cipher or :obj:`None`
    if no connection has been established.

.. versionadded:: 0.15
Nr  )r¢   ÚSSL_get_current_cipherrQ  rK  ru  r±  ÚSSL_CIPHER_get_namer  )r"  Úcipherr   s      rž   Úget_cipher_nameÚConnection.get_cipher_nameÆ  sO   € ô ×,Ò,¨T¯Y©YÓ7ˆØ”T—Y‘YÓØä—;’;œt×7Ò7¸Ó?Ó@ˆDØ—;‘;˜wÓ'Ð'r�   c                ó¶   • [         R                  " U R                  5      nU[        R                  :X  a  g[         R
                  " U[        R                  5      $ )zÔ
Obtain the number of secret bits of the currently used cipher.

:returns: The number of secret bits of the currently used cipher
    or :obj:`None` if no connection has been established.

.. versionadded:: 0.15
N)r¢   r–  rQ  rK  ru  ÚSSL_CIPHER_get_bits)r"  r˜  s     rž   Úget_cipher_bitsÚConnection.get_cipher_bitsÖ  s>   € ô ×,Ò,¨T¯Y©YÓ7ˆØ”T—Y‘YÓØä×+Ò+¨F´D·I±IÓ>Ð>r�   c                óâ   • [         R                  " U R                  5      nU[        R                  :X  a  g[        R
                  " [         R                  " U5      5      nUR                  S5      $ )zÇ
Obtain the protocol version of the currently used cipher.

:returns: The protocol name of the currently used cipher
    or :obj:`None` if no connection has been established.

.. versionadded:: 0.15
Nr  )r¢   r–  rQ  rK  ru  r±  ÚSSL_CIPHER_get_versionr  )r"  r˜  ræ  s      rž   Úget_cipher_versionÚConnection.get_cipher_versionå  sO   € ô ×,Ò,¨T¯Y©YÓ7ˆØ”T—Y‘YÓØä—k’k¤$×"=Ò"=¸fÓ"EÓFˆGØ—>‘> 'Ó*Ð*r�   c                óŒ   • [         R                  " [        R                  " U R                  5      5      nUR                  S5      $ )zõ
Retrieve the protocol version of the current connection.

:returns: The TLS version of the current connection, for example
    the value for TLS 1.2 would be ``TLSv1.2``or ``Unknown``
    for connections that were not successfully established.
r  )rK  r±  r¢   ÚSSL_get_versionrQ  r  rì  s     rž   Úget_protocol_version_nameÚ$Connection.get_protocol_version_nameõ  s0   € ô —+’+œd×2Ò2°4·9±9Ó=Ó>ˆØ�~‰~˜gÓ&Ð&r�   c                óF   • [         R                  " U R                  5      nU$ )zÏ
Retrieve the SSL or TLS protocol version of the current connection.

:returns: The TLS version of the current connection.  For example,
    it will return ``0x769`` for connections made over TLS version 1.
)r¢   ÚSSL_versionrQ  rì  s     rž   Úget_protocol_versionÚConnection.get_protocol_version   s   € ô ×"Ò" 4§9¡9Ó-ˆØˆr�   c           	     ó  • U(       d  [        S5      eSR                  [        R                  " S U 5       5      5      n[        R
                  " SU5      n[        [        R                  " U R                  U[        U5      5      S:H  5        g)a8  
Specify the client's ALPN protocol list.

These protocols are offered to the server during protocol negotiation.

:param protos: A list of the protocols to be offered to the server.
    This list should be a Python list of bytestrings representing the
    protocols to offer, e.g. ``[b'http/1.1', b'spdy/2']``.
r  r�   c              3  óP   #   • U  H  n[        [        U5      45      U4v •  M     g 7fr  r
  r  s     rž   r  Ú-Connection.set_alpn_protos.<locals>.<genexpr>  r  r  rU  r   N)r•  r  r   r  rK  rZ  rË  r¢   ÚSSL_set_alpn_protosrQ  r[  r  s       rž   r  ÚConnection.set_alpn_protos
  ss   € ö ÜÐFÓGÐGð —8‘8Ü×ÒÑF¹vÓFÓFó
ˆô —H’HÐ.°Ó9ˆ	ô 	Ü×$Ò$ T§Y¡Y°	¼3¸x»=ÓIÈQÑNõ	
r�   c                óì   • [         R                  " S5      n[         R                  " S5      n[        R                  " U R                  X5        U(       d  g[         R
                  " US   US   5      SS $ )z§
Get the protocol that was negotiated by ALPN.

:returns: A bytestring of the protocol name.  If no protocol has been
    negotiated yet, returns an empty bytestring.
r…  zunsigned int *r�   r   N)rK  rZ  r¢   ÚSSL_get0_alpn_selectedrQ  rV  )r"  rz  Údata_lens      rž   Úget_alpn_proto_negotiatedÚ$Connection.get_alpn_proto_negotiated,  sZ   € ô �xŠxÐ*Ó+ˆÜ—8’8Ð,Ó-ˆä×#Ò# D§I¡I¨tÔ>æØä�{Š{˜4 ™7 H¨Q¡KÓ0±Ð3Ð3r�   c                ó’   • [         R                  " U R                  5      nU(       d  g[        R                  " UR
                  5      $ )z§
Get the SRTP protocol which was negotiated.

:returns: A bytestring of the SRTP profile name. If no profile has been
    negotiated yet, returns an empty bytestring.
r�   )r¢   ÚSSL_get_selected_srtp_profilerQ  rK  r±  r   )r"  Úprofiles     rž   Úget_selected_srtp_profileÚ$Connection.get_selected_srtp_profile=  s1   € ô ×4Ò4°T·Y±YÓ?ˆÞØä�{Š{˜7Ÿ<™<Ó(Ð(r�   c                ó~   • [         R                  " U R                  [         R                  5      n[	        US:H  5        g)zé
Called to request that the server sends stapled OCSP data, if
available. If this is not called on the client side then the server
will not send OCSP data. Should be used in conjunction with
:meth:`Context.set_ocsp_client_callback`.
r1  N)r¢   ÚSSL_set_tlsext_status_typerQ  ÚTLSEXT_STATUSTYPE_ocsprË  )r"  r%  s     rž   Úrequest_ocspÚConnection.request_ocspJ  s1   € ô ×,Ò,Ø�I‰I”t×2Ñ2ó
ˆô 	˜˜a™Õ r�   )r\  rØ  rÏ  rÞ  rß  rX  rW  rT  rQ  rÔ  rÓ  r  )rè  rq   r[  zsocket.socket | Noner+  r,  )r   r:  r+  r   )rC  r   rE  r…   r+  r,  )r+  rq   )rè  rq   r+  r,  )r+  úbytes | NonerA  r@  r=  r?  )r“  r…   r+  r,  )r   rX  r+  r,  )r   )rk  rX  r¨  r…   r+  r…   )r·  r…   r¨  ú
int | Noner+  rX  )NN)rV  r   r¼  rÀ  r¨  rÀ  r+  r…   )r”  r   rE  r…   r+  útyping.NoReturn)r·  r…   r+  rX  )rk  rX  r+  r…   )r+  rˆ  r*  )rã  r   r+  r,  )rã  r   r+  r…   )r+  ztuple[Connection, Any])r+  rÀ  )r+  r;  )r+  zlist[X509Name])r¹  r   rº  r   r+  rÁ  rB  rC  )r"  r…   r+  r,  )r+  rX  )r<  rX  r=  r…   rè  r¿  r+  rX  )r¹  r   rº  r   r+  r,  )rI  útyping.Literal[True]r+  zx509.Certificate | None)rI  útyping.Literal[False]r+  zX509 | None)rI  ú,typing.Literal[True] | typing.Literal[False]r+  zX509 | x509.Certificate | None)r^  r   r+  z
list[X509])r^  r   r+  zlist[x509.Certificate])rI  rÂ  r+  zlist[x509.Certificate] | None)rI  rÃ  r+  zlist[X509] | None)rI  rÄ  r+  z*list[X509] | list[x509.Certificate] | None)r+  zSession | None)r-  r{   r+  r,  )r‰  zCallable[[Any, Any, int], int]r+  r¿  )r+  z
str | None)r+  r:  rD  )Sr˜   r™   rš   r›   r   r9  rÆ  r#  rb  rw  rz  r~  rƒ  r}  r†  rC  r]  r”  r™  rž  r¢  r©  Úwriter¯  r¸  Úreadr½  rÄ  rÉ  rÍ  rÒ  r×  rÐ  rÞ  râ  ræ  rê  rð  rø  rü  r   r  r°  r  r  rà  rå  r  r#  r'  r0  r4  r8  rB  rE  ÚtypingÚoverloadrJ  rT  Ústaticmethodr_  rb  re  rl  rs  rw  rë  rç  r‚  r†  r‹  r�  r“  r™  r�  r¡  r¥  r©  r  r³  r¸  r½  rœ   r–   r�   rž   rp   rp   P  s  ‡ áÓð Ð<ó ð
 @Dð:-Øð:-Ø(<ð:-à	õ:-ôx
/ô3#ôjô ô!ð$ =AðHØðHØ#9ðHà	õHô,3ô#ô08ô0)ô1ô7ô +öð4 €Eöö:+ð" €Dð
 "Ø ð	(àð(ð ð(ð ð	(ð
 
õ(ôT#ô$+ô0ô*	ô	1ô<ô8ô
*ô ôô5ô4ô$ ô7ôô$ôô:	
ôôô0ô
0ôBô,ô,ô ,ð" @Dð*Øð*Ø"%ð*Ø0<ð*à	õ*ô@6ð ‡_�_ðØ"6ðà	 óó ðð
 ‡_�_à:?ñØ"7ðà	ôó ðð INñð Fðð 
(õ	ð. ‡_�_ðØ"6ðà	 óó ðð
 ‡_�_à:?ñØ"7ðà	ôó ðð INñð Fðð 
(õ	ð, óó ðð ðØðà	óó ðð" ‡_�_ðØ"6ðà	&óó ðð
 ‡_�_à:?ñØ"7ðà	ôó ðð INñ4ð Fð4ð 
4õ	4ð. ‡_�_ðØ"6ðà	&óó ðð
 ‡_�_à:?ñØ"7ðà	ôó ðð INñ4ð Fð4ð 
4õ	4ô:-ô.ô-ô.ôô"%ð!)Ø6ð!)à	ô!)ôF	Aô	Fô(ô ?ô+ô 	'ôô 
ôD4ô")÷
!r�   )r¬  r   r+  r…   )r³  r…   r+  rX  )r¿  r…   r»  r:  r+  zCallable[[_T], _T])ñÚ
__future__r   r   r[  rú  rÇ  r=  Úcollections.abcr   rm  r   Ú	functoolsr   r   Ú	itertoolsr   r	   r
   r   r   r   r   Úweakrefr   Úcryptographyr   Ú)cryptography.hazmat.primitives.asymmetricr   ÚOpenSSL._utilr   r<  r   Ú_exception_from_error_queuer   rK  r   r¢   r   Ú_make_assertr   r³  r   ró  r   re  ÚOpenSSL.cryptor   r   r   r   r   r   r    r!   Ú__all__r,   rÆ  r+   r(   r*   r)   r'   rT   rQ   rS   rR   rP   ÚSSL_SENT_SHUTDOWNrF   ÚSSL_RECEIVED_SHUTDOWNrE   rz   r   r}   r~   rj   rk   ri   r#   r$   r"   rO   rh   re   rf   rg   ÚSSL_OP_NO_SSLv2rs   ÚSSL_OP_NO_SSLv3rt   ÚSSL_OP_NO_TLSv1ru   ÚSSL_OP_NO_TLSv1_1rv   ÚSSL_OP_NO_TLSv1_2rw   ÚSSL_OP_NO_TLSv1_3rx   ÚSSL_MODE_RELEASE_BUFFERSr%   ÚSSL_OP_SINGLE_DH_USEr>   ÚSSL_OP_SINGLE_ECDH_USEr?   ÚSSL_OP_EPHEMERAL_RSAr1   ÚSSL_OP_MICROSOFT_SESS_ID_BUGr3   ÚSSL_OP_NETSCAPE_CHALLENGE_BUGr6   Ú'SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUGr8   Ú"SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUGrA   Ú!SSL_OP_MICROSOFT_BIG_SSLV3_BUFFERr2   ÚSSL_OP_MSIE_SSLV2_RSA_PADDINGr4   ÚSSL_OP_SSLEAY_080_CLIENT_DH_BUGr@   ÚSSL_OP_TLS_D5_BUGrC   ÚSSL_OP_TLS_BLOCK_PADDING_BUGrB   Ú"SSL_OP_DONT_INSERT_EMPTY_FRAGMENTSr0   ÚSSL_OP_CIPHER_SERVER_PREFERENCEr.   ÚSSL_OP_TLS_ROLLBACK_BUGrD   ÚSSL_OP_PKCS1_CHECK_1r<   ÚSSL_OP_PKCS1_CHECK_2r=   ÚSSL_OP_NETSCAPE_CA_DN_BUGr5   Ú&SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUGr7   ÚSSL_OP_NO_COMPRESSIONr9   ÚSSL_OP_NO_QUERY_MTUr:   ÚSSL_OP_COOKIE_EXCHANGEr/   ÚSSL_OP_NO_TICKETr;   ÚSSL_OP_NO_RENEGOTIATIONr�   r<  r_  ÚSSL_OP_IGNORE_UNEXPECTED_EOFr‘   ÚSSL_OP_LEGACY_SERVER_CONNECTr’   Ú
SSL_OP_ALLr-   ÚSSL_VERIFY_PEERro   ÚSSL_VERIFY_FAIL_IF_NO_PEER_CERTrm   ÚSSL_VERIFY_CLIENT_ONCErl   ÚSSL_VERIFY_NONErn   ÚSSL_SESS_CACHE_OFFrM   ÚSSL_SESS_CACHE_CLIENTrH   ÚSSL_SESS_CACHE_SERVERrN   ÚSSL_SESS_CACHE_BOTHrG   ÚSSL_SESS_CACHE_NO_AUTO_CLEARrI   Ú!SSL_SESS_CACHE_NO_INTERNAL_LOOKUPrK   Ú SSL_SESS_CACHE_NO_INTERNAL_STORErL   ÚSSL_SESS_CACHE_NO_INTERNALrJ   rc   rb   rd   r]   rZ   r^   r`   rW   r_   ra   rV   rU   rY   rX   r\   r[   r“   r•   r&   ÚListrX  ÚUnionro  rœ  rˆ  r¨  Ú_OCSPClientCallbackÚ_OCSPServerCallbackr…   Ú_PassphraseCallbackrO  rƒ   r  r  r  r  r;  rr   r&  rË  r€   r�   r‚   r„   r|   r  r.  rR  rq  r‚  r�  rŸ  r¯  r²  ry   rÂ  r™  rK  r{   rq   rp   r–   r�   rž   Ú<module>r     sG  ðÞ "ã 	Û Û 
Û Û Ý $Ý ß $ß "Ý ß 3Ó 3Ý 'å Ý 8õõõõõõõõ÷	÷ 	ó 	òd€ðN #×9Ñ9Ð ˜Ó 9Ø×+Ñ+€�Ó +Ø×)Ñ)€�Ó )Ø×-Ñ-Ð �#Ó -Ø×#Ñ#€ˆSÓ #Ø×-Ñ-Ð �#Ó -à €Ø€Ø"€Ø€
Ø"€à×&Ñ&€Ø×.Ñ.Ð à€Ø€Ø€Ø€Ø€
ØÐ ØÐ Ø€ØÐ ØÐ à×%Ñ%€ˆcÓ %Ø×%Ñ%€ˆcÓ %Ø×)Ñ)€�Ó )Ø×)Ñ)€�Ó )Ø×)Ñ)€�Ó )à×'Ñ'€ˆSÓ 'Ø×'Ñ'€ˆSÓ 'Ø×'Ñ'€ˆSÓ 'Ø×+Ñ+€ˆsÓ +Ø×+Ñ+€ˆsÓ +Ø×+Ñ+€ˆsÓ +à ×9Ñ9Ð �cÓ 9à×1Ñ1Ð �#Ó 1Ø×5Ñ5Ð �CÓ 5Ø×1Ñ1Ð �#Ó 1Ø $× AÑ AÐ ˜#Ó AØ!%×!CÑ!CÐ ˜3Ó Cà×0Ñ0ð $ Só ð '+×&MÑ&MÐ  Ó MØ%)×%KÑ%KÐ ˜sÓ KØ!%×!CÑ!CÐ ˜3Ó CØ#'×#GÑ#GÐ ˜SÓ GØ×+Ñ+€ˆsÓ +Ø $× AÑ AÐ ˜#Ó AØ&*×&MÑ&MÐ  Ó MØ#'×#GÑ#GÐ ˜SÓ GØ×7Ò7Ð �SÓ 7Ø×,Ò,Ð Ø×1Ò1Ð �#Ó 1Ø!×;Ò;Ð �sÓ ;à×/Ò/ð # Có ð ×3Ò3Ð �3Ó 3à×/Ò/€�Ó /Ø×5Ò5Ð �CÓ 5Ø×)Ò)€ˆcÓ )ð	Ø#×;Ò;Ð˜Ó;Ø‡N‚NÐ(Ô)ð	Ø$(×$EÒ$EÐ˜cÓEØ‡N‚NÐ-Ô.ð	Ø$(×$EÒ$EÐ˜cÓEØ‡N‚NÐ-Ô.ð �oŠo€ˆÓ à×'Ò'€ˆSÓ 'Ø#'×#GÒ#GÐ ˜SÓ GØ×5Ò5Ð �CÓ 5Ø×'Ò'€ˆSÓ 'à×-Ò-€�Ó -Ø×3Ò3Ð �3Ó 3Ø×3Ò3Ð �3Ó 3Ø×/Ò/€�Ó /Ø $× AÒ AÐ ˜#Ó AØ%)×%KÒ%KÐ ˜sÓ KØ$(×$IÒ$IÐ ˜cÓ IØ"×=Ò=Ð ˜Ó =à×)Ò)€�Ó )Ø×'Ò'€ˆsÓ 'Ø×#Ò#€ˆSÓ #à×#Ò#€ˆSÓ #Ø×#Ò#€ˆSÓ #Ø×#Ò#€ˆSÓ #Ø×%Ò%€ˆcÓ %Ø×%Ò%€ˆcÓ %Ø×/Ò/Ð �3Ó /Ø×1Ò1Ð �CÓ 1Ø×1Ò1Ð �CÓ 1Ø×1Ò1Ð �CÓ 1Ø×3Ò3Ð �SÓ 3Ø×3Ò3Ð �SÓ 3Ø"×9Ò9Ð ˜Ó 9Ø!×7Ò7Ð �sÓ 7áˆTƒ]€÷	ñ 	ñ 3Ó4Ð ð àØ�Š�EÑðð ‡L‚L�Ð/Ð/Ñ0ð	2ñÐ ð # L >°5Ð#8Ñ9Ð Ø  ,°Ð!6¸Ð!<Ñ=Ð Ø ¨e°X¸b±\ÐBÀDÐHÑIÐ Ø ¨h°r©lÐ;¸UÐBÑCÐ Ø  T¨8°B©<Ð8¸%Ð?Ñ@Ð Ø˜L¨$°°S¸#Ð>ÀÐDÑE€÷gLñ gLòVÐ ð ðÐ ð "IÐ Ø"LÐ ôˆIô ñ Ð:¸EÓBÐ Ù˜uÓ%€ô	�Eô 	ô	�Uô 	ô	˜%ô 	ô	�eô 	ô	�5ô 	÷(ñ (ô8%
Ð,ô %
ôP:
Ð0ô :
ôz@IÐ 8ô @IôF8IÐ 8ô 8Iôv
Ð$<ô 
ô<
Ð":ô 
ô&ô(3ð !€ôñ2 "ÙˆDÐ+¨QÓ/Ð1LóÐ ÷
	ñ 	÷G
ñ G
÷T D!ò D!øðS3 ó 	Úð	ûð ó 	Úð	ûð ó 	Úð	ús6   Î$^ Î=$^ Ï"$^" Þ^Þ^Þ^Þ^Þ"^,Þ+^,