MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _msg_callback

Method _msg_callback

tools/python-3.11.9-amd64/Lib/ssl.py:644–680  ·  view source on GitHub ↗

TLS message callback The message callback provides a debugging hook to analyze TLS connections. The callback is called for any TLS protocol message (header, handshake, alert, and more), but not for application data. Due to technical limitations, the callback ca

(self)

Source from the content-addressed store, hash-verified

642
643 @property
644 def _msg_callback(self):
645 """TLS message callback
646
647 The message callback provides a debugging hook to analyze TLS
648 connections. The callback is called for any TLS protocol message
649 (header, handshake, alert, and more), but not for application data.
650 Due to technical limitations, the callback can't be used to filter
651 traffic or to abort a connection. Any exception raised in the
652 callback is delayed until the handshake, read, or write operation
653 has been performed.
654
655 def msg_cb(conn, direction, version, content_type, msg_type, data):
656 pass
657
658 conn
659 :class:`SSLSocket` or :class:`SSLObject` instance
660 direction
661 ``read`` or ``write``
662 version
663 :class:`TLSVersion` enum member or int for unknown version. For a
664 frame header, it's the header version.
665 content_type
666 :class:`_TLSContentType` enum member or int for unsupported
667 content type.
668 msg_type
669 Either a :class:`_TLSContentType` enum number for a header
670 message, a :class:`_TLSAlertType` enum member for an alert
671 message, a :class:`_TLSMessageType` enum member for other
672 messages, or int for unsupported message types.
673 data
674 Raw, decrypted message content as bytes
675 """
676 inner = super()._msg_callback
677 if inner is not None:
678 return inner.user_function
679 else:
680 return None
681
682 @_msg_callback.setter
683 def _msg_callback(self, callback):

Callers

nothing calls this directly

Calls 1

__set__Method · 0.45

Tested by

no test coverage detected