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

Method __init__

Lib/test/test_ssl.py:2751–2784  ·  view source on GitHub ↗
(self, certificate=None, ssl_version=None,
                 certreqs=None, cacerts=None,
                 chatty=True, connectionchatty=False, starttls_server=False,
                 alpn_protocols=None,
                 ciphers=None, context=None)

Source from the content-addressed store, hash-verified

2749 self.running = False
2750
2751 def __init__(self, certificate=None, ssl_version=None,
2752 certreqs=None, cacerts=None,
2753 chatty=True, connectionchatty=False, starttls_server=False,
2754 alpn_protocols=None,
2755 ciphers=None, context=None):
2756 if context:
2757 self.context = context
2758 else:
2759 self.context = ssl.SSLContext(ssl_version
2760 if ssl_version is not None
2761 else ssl.PROTOCOL_TLS_SERVER)
2762 self.context.verify_mode = (certreqs if certreqs is not None
2763 else ssl.CERT_NONE)
2764 if cacerts:
2765 self.context.load_verify_locations(cacerts)
2766 if certificate:
2767 self.context.load_cert_chain(certificate)
2768 if alpn_protocols:
2769 self.context.set_alpn_protocols(alpn_protocols)
2770 if ciphers:
2771 self.context.set_ciphers(ciphers)
2772 self.chatty = chatty
2773 self.connectionchatty = connectionchatty
2774 self.starttls_server = starttls_server
2775 self.sock = socket.socket()
2776 self.port = socket_helper.bind_port(self.sock)
2777 self.flag = None
2778 self.active = False
2779 self.selected_alpn_protocols = []
2780 self.shared_ciphers = []
2781 self.conn_errors = []
2782 threading.Thread.__init__(self)
2783 self.daemon = True
2784 self._in_context = False
2785
2786 def __enter__(self):
2787 if self._in_context:

Callers 5

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

set_alpn_protocolsMethod · 0.80
socketMethod · 0.80

Tested by

no test coverage detected