Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
tls.cpython-313.pyc160 linesDownload Raw Back to __pycache__
1�

2��jCf��2�SSKrSSKrSSKrSSKJr SSKJr SSKJr SSKJ	r	 SSKJ3r4 SSKJr SSKJ
r
 SS	KJr SS5KJr SSKJr SSKJr SS
KJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJ r  SSK!J"r" SSK!J#r# SSK!J$r$ SSK%J&r& S\'S\\'4Sjr(S\'S\'S-4Sjr)S\'S\"S-4Sjr*S\'S\\'4Sjr+S\'S\'S-4S jr,S\'S\"S-4S!jr-S"r.S#r/S$r0\0\//\.Q7r1\"S%S&\55r2\"S'S(\55r3\"S)S*\55r4\"S+S,\55r5\"S-S.\55r6\"S/S0\55r7\"S1S2\55r8"S3S4\Rr5r:"S5S6\:5r;"S7S8\:5r<"S9S:\:5r=g);�N)�Iterator)�	dataclass)�DEBUG)�ERROR)�INFO)�WARNING)�SSL)�certs)�6connection)�7TlsVersion)�starts_like_dtls_record)�starts_like_tls_record)�commands)�context)�events)�layer)�tunnel)�	StartHook)�tcp)�udp)�ClientHello)�ClientHelloData)�TlsData)�human�data�returnc#�.# �Sn[U5US-:agXUS-n[U5(d[SU<S35e[R"SUSS5SnUS:Xa[S5eUS-
n[U5X-:agXX-nUv� X-
nM�7f)	��8Returns a generator that yields the bytes contained in each handshake record.9This will raise an error on the first non-handshake record, so fully exhausting this10generator is a bad idea.11r�NzExpected TLS record, got �	 instead.�!H��Record must not be empty.)�lenr�12ValueError�struct�unpack�r�offset�
record_header�record_size�record_bodys     �`D:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/proxy/layers/tls.py�handshake_record_contentsr. s�����F�13��t�9�v��z�!���f�q�j�1�
�%�m�4�4��8��8I��S�T�T��m�m�D�-���*;�<�Q�?���!���8�9�9��!����t�9�v�+�+���F�$8�9����������BBc���Sn[U5HQnX-
n[U5S:�dM[R"SSUSS-5SS-n[U5U:�dMLUSUs $ g)z�14Read all TLS records that contain the initial ClientHello.15Returns the raw handshake packet bytes, without TLS record headers.16���!I��rN)r.r$r&r'�r�client_hello�d�client_hello_sizes    r-�get_client_hellor:9sx��17�L�
&�t�
,������|���!� &�
�
�d�G�l�1�Q�>O�4O� P�QR� S�VW� W���<� �$5�5�#�$6�%6�7�7�-�r1c��[U5nU(a[USS5$g![an[S5UeSnAff=f)��18Check if the supplied bytes contain a full ClientHello message,19and if so, parse it.20 21Returns:22    - A ClientHello object on success23    - None, if the TLS record is not complete24 25Raises:26    - A ValueError, if the passed ClientHello is invalid27r2N�Invalid ClientHello)r:r�EOFErrorr%�rr7�es   r-�parse_client_hellorAHsM��$�D�)�L��	;��|�A�B�/�0�0����	;��2�3��:��	;�s�
#�28>�9�>c#�.# �Sn[U5US-:agXUS-n[U5(d[SU<S35e[R"SUSS5SnUS:Xa[S5eUS-
n[U5X-:agXX-nUv� X-
nM�7f)	rr�
NzExpected DTLS record, got r r!�r#)r$r
r%r&r'r(s     r-�dtls_handshake_record_contentsrE^s�����F�29��t�9�v��{�"���f�r�k�2�
�&�}�5�5��9�-�9J�)�T�U�U��m�m�D�-���*<�=�a�@���!���8�9�9��"����t�9�v�+�+���F�$8�9�������#�r/c���Sn[U5HQnX-
n[U5S:�dM[R"SSUSS-5SS-n[U5U:�dMLUSUs $ g)	z�30Read all DTLS records that contain the initial ClientHello.31Returns the raw handshake packet bytes, without TLS record headers.32r1rCr3r4�	�rN)rEr$r&r'r6s    r-�get_dtls_client_hellorIys|��33�L�
+�D�
1������|���"��
�
�d�G�l�1�R�.@�$@�A�!�D�r�I�
��<� �$5�5�#�$6�%6�7�7�2�r1c��[U5nU(a[USSSS9$g![an[S5UeSnAff=f)r<rHNT)�dtlsr=)rIrr>r%r?s   r-�dtls_parse_client_hellorL�sO��)��.�L��	;��|�B�C�0�t�<�<����	;��2�3��:��	;�s�"�34=�8�=)shttp/1.1shttp/1.0shttp/0.9sh2sh3c�$�\rSrSr%Sr\\S'Srg)�TlsClienthelloHook�z�35Mitmproxy has received a TLS ClientHello message.36 37This hook decides whether a server connection is needed38to negotiate TLS with the client (data.establish_server_tls_first)39r�N)�__name__�40__module__�__qualname__�__firstlineno__�__doc__r�__annotations__�__static_attributes__rPr1r-rNrN�s����r1rNc�$�\rSrSr%Sr\\S'Srg)�TlsStartClientHook�z�41TLS negotation between mitmproxy and a client is about to start.42 43An addon is expected to initialize data.ssl_conn.44(by default, this is done by `mitmproxy.addons.tlsconfig`)45rrPN�rQrRrSrTrUrrVrWrPr1r-rYrY������Mr1rYc�$�\rSrSr%Sr\\S'Srg)�TlsStartServerHook��z�46TLS negotation between mitmproxy and a server is about to start.47 48An addon is expected to initialize data.ssl_conn.49(by default, this is done by `mitmproxy.addons.tlsconfig`)50rrPNr[rPr1r-r^r^�r\r1r^c�$�\rSrSr%Sr\\S'Srg)�TlsEstablishedClientHook��zD51The TLS handshake with the client has been completed successfully.52rrPNr[rPr1r-rara������Mr1rac�$�\rSrSr%Sr\\S'Srg)�TlsEstablishedServerHook��zD53The TLS handshake with the server has been completed successfully.54rrPNr[rPr1r-rere�rcr1rec�$�\rSrSr%Sr\\S'Srg)�TlsFailedClientHook��z/55The TLS handshake with the client has failed.56rrPNr[rPr1r-rhrh�rcr1rhc�$�\rSrSr%Sr\\S'Srg)�TlsFailedServerHook��z/57The TLS handshake with the server has failed.58rrPNr[rPr1r-rkrk�rcr1rkc�8^�\rSrSr%Sr\R\S'S\RS\59R4U4SjjrU4Sjr\
S5r\
S	5rS60\R"S4SjrS61\R"S4SjrS
\S62\R"\\\S-44SjrS\S63\R"S4U4SjjrS
\S64\R"S4SjrS65\R"S4U4SjjrS
\S66\R"S4SjrS\R<S67\R"S4U4SjjrSr U=r!$)�TLSLayer��N�tlsr�connc�2>�[TU]UUUS9 SUlg)N)�tunnel_connectionrqT)�super�__init__rp��selfrrq�	__class__s   �r-ru�TLSLayer.__init__�s'���
����"��	�	68���r1c�>�[TU]5RSSURR<SURR69<S35$)N�)� )rt�__repr__�replacerq�sni�alpn�rwrxs �r-r}�TLSLayer.__repr__�sB����G���&�&�s�a��	�	�
�
�/@��$�)�)�.�.�AS�ST�,U�V�	70r1c�4�URRS:H$)Nr)rq�transport_protocol�rws r-�is_dtls�TLSLayer.is_dtlss���y�y�+�+�u�4�4r1c�,�UR(aS$S$)N�DTLS�TLS�r�r�s r-�71proto_name�TLSLayer.proto_names�����v�0�5�0r1rc#�# �UR(ae[URURURS9nURURR72:Xa[
U5v� O
[U5v� UR(dN[R"SURS3[5v� [R"UR5v� gUR(deURUlg7f)Nr�zNo z* context was provided, failing connection.)rprrqrr��clientrYr^�ssl_connr�Logr�r�CloseConnection)rw�	tls_starts  r-�	start_tls�TLSLayer.start_tlss�����8�8��|��D�I�I�t�|�|�T�\�\�J�	��9�9����+�+�+�$�Y�/�/�$�Y�/�/��!�!��,�,��d�o�o�&�&P�Q�SX��
��*�*�4�9�9�5�5���!�!�!�!��%�%���s�DDc#��# �URRS5n[R"URU5v� MA![73Ra gf=f7f)N���)rp�bio_readr�SendDatarqr	�
WantReadError�rwrs  r-�tls_interact�TLSLayer.tls_interactsX����
9��x�x�(�(��/���'�'��	�	�4�8�8�
���$�$�
��
�s'�A�A�%A�A�A�A�Arc#�6	# �U(aURRU5 URR5 URR5=(d /nURUR74R:Xa3URR5nU(aURSU5 /URl	UHHn[RRU5nURRRU5 MJ [&R&"5URlURR+5URlURR/5URl[2R4"[6URR955URlUR"(a6[R "UR"SUR3[<5v� URUR75R:Xa7[?[AURUR76UR55v� O6[C[AURUR77UR55v� URES5Shv�N g![a8n[R "UR"SU3[$5v� SnAGM3SnAff=fNJ![FRHa URK5Shv�N g[FRLGaInURN=(aL [QURNS[R5=(a( URNS=(a URNSSnUS;a�[FRTRWURRX5n[FRZR][FRTR_U55Ra5nS	U3n	OSUS78;a[QU[b5(deUSn	O0US;aUSS
Re5(aSn	OUS;aSn	OSU<3n	SU	4sSnA$SnAff=f7f)Nrz#[tls] failed to parse certificate: z[tls] tls established: r1�TN�FN�����))�SSL routines�tls_process_server_certificate�certificate verify failed)r��r�zCertificate verify failed: ))r��ssl3_read_bytes�tlsv1 alert unknown ca)r�r��sslv3 alert bad certificate)r�r��ssl/tls alert bad certificate)r�r�r�)r�r�r�)r�r�r��))r��ssl3_get_record�wrong version number)r�r�r�)r�r�zpacket length too long)r�r�zrecord layer failurer2z%The remote server does not speak TLS.))r�r��tlsv1 alert protocol version)r�r�r�z�The remote server and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_server_min option.zOpenSSL F)3rp�	bio_write�do_handshake�get_peer_cert_chainrqrr��get_peer_certificate�insert�certificate_listr79�Cert�from_pyopenssl�appendr%rr��debugr�time�timestamp_tls_setup�get_alpn_proto_negotiatedr��get_cipher_name�cipher�typing�castr�get_protocol_version_name�tls_versionrrarre�receive_datar	r�r��Error�args�80isinstance�list�_lib�SSL_get_verify_result�_ssl�_ffi�string�X509_verify_cert_error_string�decode�tuple�isascii)81rwr�	all_certs�cert�parsed_certr@�last_err�
verify_result�error�errs82          r-�receive_handshake_data�TLSLayer.receive_handshake_data&s������H�H���t�$�b	��H�H�!�!�#�z���4�4�6�<�"�I��y�y�D�L�L�/�/�/��x�x�4�4�6����$�$�Q��-�)+�D�I�I�&�!��C�"'�*�*�";�";�D�"A�K��I�I�.�.�5�5�k�B�"�-1�I�I�K�D�I�I�)�!�X�X�?�?�A�D�I�I�N�#�x�x�7�7�9�D�I�I��$*�K�K��D�H�H�>�>�@�%�D�I�I�!��z�z��l�l��z�z�l�"9�$�)�)��E�u����y�y�D�L�L�/�/�/�.��D�I�I�t�|�|�T�X�X�>���/��D�I�I�t�|�|�T�X�X�>����(�(��-�-�-���5"��"�,�,��:�:�,�&I�!��M�w�������2
.��� � �	��(�(�*�*�*���y�y�1	����V�:�a�f�f�Q�i��6�V�1�6�6�!�9�V����PQ��SU��
����!$��� >� >�t�x�x�}�}� M�
�������H�H�:�:�=�I���&�(��4�E�7�;�����"�(�E�2�2�2�2��q�k�������!�H�$�$�&�&�=�����83X��84!���&���#�:���c1	�s��#R�L85�BR�K�0G
R�=L�>R�86L�
,L�9R�L�R�87'R�1L4�2R�7R�9R�
D>R�R�R�R�Rr�c#�># �XRlURURR:Xa7[	[URURUR55v� O6[[URURUR55v� [TU]%U5Shv�N gN7f�N)88rqr�rr�rhrrprkrt�on_handshake_error�rwr�rxs  �r-r��TLSLayer.on_handshake_error�sx�����	�	���9�9����+�+�+�%�g�d�i�i����t�x�x�&P�Q�Q�%�g�d�i�i����t�x�x�&P�Q�Q��7�-�c�2�2�2�s�B4B?�7B=�8B?c#��# �U(aURRU5 [5nSnURURR	S55 M-![89Ra OW[90Ra SnO@[91Ra*n[R"SU3[5v� SnAOSnAff=fUR5Shv�N U(aBUR[R"UR [#U555Shv�N U(a�UR =R$[&R(R*)-slUR,(a6[R"UR,SUR 3[.5v� UR[R0"UR 55Shv�N gg7f)NFTr�zTLS Error: z[tls] close_notify )rpr��	bytearray�extend�recvr	r��ZeroReturnErrorr�rr�rr��event_to_childr�DataReceivedrq�bytes�stater�ConnectionState�CAN_READr�r�ConnectionClosed)rwr�	plaintext�closer@s     r-r��TLSLayer.receive_data�sk�����H�H���t�$��K�	����
�� � ������u�!5�6����$�$�
���&�&�
�����9�9�
��l�l�[���#4�g�>�>���
���$�$�&�&�&���*�*��#�#�D�I�I�u�Y�/?�@��
�
���I�I�O�O�92� :� :� C� C�C�C�O��z�z��l�l�d�j�j�\�1D�T�Y�Y�K�#P�RW�X�X��*�*�6�+B�+B�4�9�9�+M�N�N�N�	�sl�0G.�*A�G.�C	�3G.�5C	�93G.�C	� C�?G.�C	�	G.�C"� AG.�(D+�)B=G.�&G)�'G.c#�># �URR5[R-(ag[TU]5Shv�N gN7fr�)rp�get_shutdownr	�RECEIVED_SHUTDOWNrt�
receive_closer�s �r-r��TLSLayer.receive_close�s5�����8�8� � �"�S�%:�%:�:���w�,�.�.�.�s�AA�A�Ac#��# �URRU5 UR5Shv�N g![R[R4a N?f=fN/7fr�)rp�sendallr	r��SysCallErrorr�r�s  r-�	send_data�TLSLayer.send_data�sZ���	��H�H���T�"��$�$�&�&�&���#�#�S�%5�%5�6�	��	��	'�s/�A$�8�A$�A"�A$�$A�A$�A�A$�commandc#�@># �[TU]U5Shv�N gN7fr�)rt�94send_close)rwr�rxs  �r-r��TLSLayer.send_close�s�����7�%�g�.�.�.�s���)rp)"rQrRrSrTrpr	�95ConnectionrVr�Contextrrur}�propertyr�r�r�CommandGeneratorr�r�r�r��bool�strr�r�r�r�r�rr�r�rW�
__classcell__�rxs@r-rnrn�s^����C�����'������z�7L�7L��96�97�5��5��1��1�&�5�1�1�$�7�&�"9�e�4�4�T�:�9�h��h�	�	�	��d�C�$�J�&6� 7�	8�h�T3�c�3�e�.D�.D�T�.J�3�$O��$O�5�+A�+A�$�+G�$O�L/�u�5�5�d�;�/�'�e�'��(>�(>�t�(D�'�/��/�/�/�	�	�	��	%�/�/r1rnc�^�\rSrSr%SrSr\\S'SS\RS\98RS-4U4SjjjrS	\
RS4S99jrS\R"S	\
RS4U4SjjrS
\S	\
RS4U4SjjrSrU=r$)�ServerTLSLayeri�z<100This layer establishes TLS for a single server connection.101F�wait_for_clienthelloNrrqc�J>�[TU]X=(d UR5 gr�)rtru�serverrvs   �r-ru�ServerTLSLayer.__init__�s���
����"8�'�.�.�9r1rc#�Z# �UR(+=(a [UR[5nU(a'SUl[102RRUlgUR5Shv�N UR(aURS5Shv�N ggN0N7f)NTr1)�command_to_reply_tor��child_layer�ClientTLSLayerrr�TunnelState�CLOSED�tunnel_stater�rpr�)rwrs  r-�start_handshake�ServerTLSLayer.start_handshake�s�����(�(�(�
=�103�4�+�+�^�<�	� �(,�D�%� &� 2� 2� 9� 9�D���~�~�'�'�'��x�x��6�6�s�;�;�;��
(�;�s$�A4B+�6B'�7)B+� B)�!B+�)B+�eventc#�># �UR(a][TU]	U5HIn[U[R1045(a#URUR:Xa	SUlMEUv� MK g[TU]	U5Shv�N gN7f)NF)rrtr�r�r�OpenConnectionrrq)rwrr�rxs   �r-r��ServerTLSLayer.event_to_child�sl�����$�$� �7�1�%�8���w��(?�(?�@�@��*�*�d�i�i�7�05�D�-�"�M�9��w�-�e�4�4�4�s�BB�B105�Br�c#�|># �[R"SU3[S9v� [TU]U5Shv�N gN7f)NzServer TLS handshake failed. ��level)rr�rrtr�r�s  �r-r��!ServerTLSLayer.on_handshake_error�s2�����l�l�:�3�%�@��P�P��7�-�c�2�2�2�s�1<�:�<)rrr�)rQrRrSrTrUrr�rVrr�r�Serverrurr�rr�Eventr�r�r�rWrrs@r-rr�s�����"'��$�&�:����:�z�7H�7H�4�7O�:�:�<��!7�!7��!=�<�&5�F�L�L�5�U�5K�5K�D�5Q�5�3�c�3�e�.D�.D�T�.J�3�3r1rc�v^�\rSrSr%Sr\\S'\\S'Sr\\S'S\	R4U4SjjrS	\RS1064SjrS\S	\R\\\S107-44U4S
jjrS	\R\S108-4SjrS\S	\RS1094U4SjjrS\R,S	\RS1104SjrSrU=r$)riu�111This layer establishes TLS on a single client connection.112 113┌─────┐114│Start│115└┬────┘116 ↓117┌────────────────────┐118│Wait for ClientHello│119└┬───────────────────┘120 ↓121┌────────────────┐122│Process messages│123└────────────────┘124 125�recv_buffer�server_tls_availableF�client_hello_parsedrc�>�URR(a�SURlSURlSURlSURlSURl/URlSURl/URl	/URl126[TU]1XR5 [URRS[ 5Ul[%5Ulg)N�����)r�rpr�r�rr�r�r��mitmcert�alpn_offers�cipher_listrtrur�r�layersrrr�r)rwrrxs  �r-ru�ClientTLSLayer.__init__s�����>�>���#'�G�N�N��$(�G�N�N�!�!%�G�N�N��15�G�N�N�.�)-�G�N�N�&�.0�G�N�N�+�&*�G�N�N�#�)+�G�N�N�&�)+�G�N�N�&�
����.�.�1�$.�t�|�|�/B�/B�2�/F��$W��!�$�;��r1rNc#�$# �SShv�N gN7f)NrPrPr�s r-r�ClientTLSLayer.start_handshake/s����
�
�s���rc	#�B># �UR(a[TU]	U5Shv�N$URR	U5 UR127(a[
UR5nO[UR5nU(aSUlOgURURl128URURl
[URU5n[!U5v� UR"(Ga_[$R&"SSS9=UlUlURR*URR*R-U5S-129n[/U[05(a [$R2"SS9=UlUlUR130(a%[4R6"URSS	9UlO$[:R<"URSS	9UlUR?[@RB"URRD[GUR555Shv�N URRI5 g131URJ(azURRLRN(dUURQ5Shv�NnU(a6[RRT"SURVSUS
URVS35v� URY5Shv�N URRZ(dg[TU]	[GUR55Shv�NnURRI5 U$GN=![a" SSURR534s$f=fGNWN�N�NY7f)NFzCannot parse ClientHello: Tr�)zignore-connr)�peername�socknamer5��address)�ignorer�zUnable to establish z connection with server (z). Trying to establish z� with client anyway. If you plan to redirect requests away from this server, consider setting `connection_strategy` to `lazy` to suppress early connections.)F�connection closed early).rrtr�rr�r�rLrAr%�hexrrq�alpn_protocolsr"rrrN�ignore_connectionr�Clientrsr$�indexr�rrr�UDPLayerr132r�TCPLayerr�rr�r�r��clear�establish_server_tls_firstr�tls_established�start_server_tlsrr�r�r��	connected)rwrr7�tls_clienthello�parent_layerr��retrxs       �r-r��%ClientTLSLayer.receive_handshake_data2s������#�#�$�w�=�d�C�C�D�������%�	P��|�|�6�t�7G�7G�H��1�$�2B�2B�C���'+�D�$��$�(�(��	�	�
� ,� ;� ;��	�	��)�$�,�,��E�� ��1�1��,�,�,�2<�1B�1B�+�6H�2�
�D�I��.� �<�<�.�.�t�|�|�/B�/B�/H�/H��/N�QR�/R�S�L��,��7�7�EO�EV�EV� �F���!�L�$B��|�|�#&�<�<����T�#J�� �#&�<�<����T�#J�� ��*�*��#�#�D�L�L�$7�$7��t�?O�?O�9P�Q��
�
�
���"�"�$���6�6��L�L�'�'�7�7�!�2�2�4�4�C���l�l�*�4�?�?�*;�;T�UX�TY�Z+�+/�?�?�*;�<f�g����>�>�#�#�#��y�y�"�"�3���7��d�>N�>N�8O�P�P������� ��133�wD���	P��6�t�7G�7G�7K�7K�7M�6N�O�O�O�	P��8
�5�	$�Q�s��$N�M$�N�&M'�.N�/M'�F;N�?N�A(N�(N�)AN�=N�>AN�N�!N�')N�N�N�N�N�N�Nc#�# �UR(dSURS3$[R"URR1345v�nU$7f)z�135We often need information from the upstream connection to establish TLS with the client.136For example, we need to check if the client does ALPN or not.137z138No server z available.)rr�rrrr)rwr�s  r-r9�ClientTLSLayer.start_server_tlsssF���139�(�(�����0��<�<��+�+�D�L�L�,?�,?�@�@���140�s�AAr�c#�D># �URR(aURRnO4[R"URR141R5n[nURS5(aONSU;dSU;aSnO?SU;dSU;dSU;a142SUS	US1433nO#US:Xa
SUS
3n[nOUS:XaO	SUS	US1443nUS:wa[R"SU3US9v� [TU]5U5Shv�N URUlgN7f)NzCannot parse ClientHellozO('SSL routines', 'tls_early_post_process_client_hello', 'unsupported protocol')z,('SSL routines', '', 'unsupported protocol')z|Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min option.z145unknown cazbad certificatezcertificate unknownz6The client does not trust the proxy's certificate for z (r{zconnection closedzOThe client disconnected during the handshake. If this happens consistently for zK, this may indicate that the client does not trust the proxy's certificate.r.z5The client may not trust the proxy's certificate for zClient TLS handshake failed. r)rqrr�format_addressrrr,r�146startswithrrr�rtr��erroredr�)rwr��destrrxs    �r-r��!ClientTLSLayer.on_handshake_error}sA�����9�9�=�=��9�9�=�=�D��'�'����(;�(;�(C�(C�D�D����>�>�4�5�5��]��
�=��D�T�
�147
�C�� �C�'�$��+�I���b�QT�PU�UV�W�
��'�
'�a�bf�ag�h\�]�
��E�
�-�
-��I�$��r�RU�QV�VW�X�C��+�+��,�,�!>�s�e�D�E�R�R��7�-�c�2�2�2�"�l�l���	3�s�DD �D�D rc#�# �URb.[R"URSUS3[5v� gg7f)Nz[tls] Swallowing z as handshake failed.)r�rr�r)rwrs  r-rD�ClientTLSLayer.errored�s=����:�:�!��,�,��:�:�,�/��w�6K�L�e��
�"�s�=?)r148rrqr�rrrs)rQrRrSrTrUr�rVr�rrr�rurr�rr�r�r�r�r9r�rrrDrWrrs@r-rrs�����"���� %���%�'����'�,��!7�!7��!=��?��?�	�	�	��d�C�$�J�&6� 7�	8�?�B�%�"8�"8��t��"D��&+�c�&+�e�.D�.D�T�.J�&+�P�V�\�\��e�.D�.D�T�.J��r1rc�H^�\rSrSrSrS\R4U4SjjrSrU=r	$)�MockTLSLayeri�z�Mock layer to disable actual TLS and use cleartext in tests.149 150Use like so:151    monkeypatch.setattr(tls, "ServerTLSLayer", tls.MockTLSLayer)152�ctxc�J>�[TU]U[R"SS95 g)Nr+)rtrurr)rwrKrxs  �r-ru�MockTLSLayer.__init__�s���
����j�/�/��=�>r1rP)153rQrRrSrTrUrr�rurWrrs@r-rJrJ�s����?�G�O�O�?�?r1rJ)>r&r�r��collections.abcr�dataclassesr�loggingrrrr�OpenSSLr	�	mitmproxyr154r�mitmproxy.connectionr�mitmproxy.net.tlsr
r�mitmproxy.proxyrrrrr�mitmproxy.proxy.commandsr�mitmproxy.proxy.layersrr�
mitmproxy.tlsrrr�mitmproxy.utilsrr�r.r:rArErIrL�HTTP1_ALPNS�155HTTP2_ALPN�156HTTP3_ALPN�157HTTP_ALPNSrNrYr^rarerhrk�TunnelLayerrnrrrJrPr1r-�<module>r_s���
��
�$�!������� �+�5�4�$�#�"�!�"�.�&�&�%�)�!�!��E��h�u�o��2�5��U�T�\���U��{�T�'9��,���8�E�?��6���%�$�,��$�%��K�$�,>��,6��
�158�
�159��*�
3�{�
3�160���������������������y������y������)������)����^/�v�!�!�^/�B-3�X�-3�`f�X�f�R?�8�?r1
codekingpro/portable-devtools · Team Ai