MCPcopy Index your code
hub / github.com/RustPython/RustPython / __init__

Method __init__

Lib/test/test_ssl.py:2472–2505  ·  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

2470 self.running = False
2471
2472 def __init__(self, certificate=None, ssl_version=None,
2473 certreqs=None, cacerts=None,
2474 chatty=True, connectionchatty=False, starttls_server=False,
2475 alpn_protocols=None,
2476 ciphers=None, context=None):
2477 if context:
2478 self.context = context
2479 else:
2480 self.context = ssl.SSLContext(ssl_version
2481 if ssl_version is not None
2482 else ssl.PROTOCOL_TLS_SERVER)
2483 self.context.verify_mode = (certreqs if certreqs is not None
2484 else ssl.CERT_NONE)
2485 if cacerts:
2486 self.context.load_verify_locations(cacerts)
2487 if certificate:
2488 self.context.load_cert_chain(certificate)
2489 if alpn_protocols:
2490 self.context.set_alpn_protocols(alpn_protocols)
2491 if ciphers:
2492 self.context.set_ciphers(ciphers)
2493 self.chatty = chatty
2494 self.connectionchatty = connectionchatty
2495 self.starttls_server = starttls_server
2496 self.sock = socket.socket()
2497 self.port = socket_helper.bind_port(self.sock)
2498 self.flag = None
2499 self.active = False
2500 self.selected_alpn_protocols = []
2501 self.shared_ciphers = []
2502 self.conn_errors = []
2503 threading.Thread.__init__(self)
2504 self.daemon = True
2505 self._in_context = False
2506
2507 def __enter__(self):
2508 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 5

socketMethod · 0.80
load_verify_locationsMethod · 0.45
load_cert_chainMethod · 0.45
set_alpn_protocolsMethod · 0.45
set_ciphersMethod · 0.45

Tested by

no test coverage detected