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

Method set_alpn_protocols

Lib/ssl.py:504–513  ·  view source on GitHub ↗
(self, alpn_protocols)

Source from the content-addressed store, hash-verified

502 self.sni_callback = shim_cb
503
504 def set_alpn_protocols(self, alpn_protocols):
505 protos = bytearray()
506 for protocol in alpn_protocols:
507 b = bytes(protocol, 'ascii')
508 if len(b) == 0 or len(b) > 255:
509 raise SSLError('ALPN protocols must be 1 to 255 in length')
510 protos.append(len(b))
511 protos.extend(b)
512
513 self._set_alpn_protocols(protos)
514
515 def _load_windows_store_certs(self, storename, purpose):
516 try:

Callers 5

_create_https_contextFunction · 0.80
_create_contextMethod · 0.80
__init__Method · 0.80
test_alpn_protocolsMethod · 0.80

Calls 2

appendMethod · 0.45
extendMethod · 0.45

Tested by 3

__init__Method · 0.64
test_alpn_protocolsMethod · 0.64