MCPcopy Index your code
hub / github.com/python/cpython / do_ssl_object_handshake

Function do_ssl_object_handshake

Lib/test/test_ssl.py:388–399  ·  view source on GitHub ↗

Call do_handshake() on the sslobject and return the sent data. If do_handshake() fails more than *max_retry* times, return None.

(sslobject, outgoing, max_retry=25)

Source from the content-addressed store, hash-verified

386
387
388def do_ssl_object_handshake(sslobject, outgoing, max_retry=25):
389 """Call do_handshake() on the sslobject and return the sent data.
390
391 If do_handshake() fails more than *max_retry* times, return None.
392 """
393 data, attempt = None, 0
394 while not data and attempt < max_retry:
395 with contextlib.suppress(ssl.SSLWantReadError):
396 sslobject.do_handshake()
397 data = outgoing.read()
398 attempt += 1
399 return data
400
401
402class BasicSocketTests(unittest.TestCase):

Calls 2

do_handshakeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…