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

Function make_https_server

Lib/test/ssl_servers.py:150–168  ·  view source on GitHub ↗
(case, *, context=None, certfile=CERTFILE,
                      host=HOST, handler_class=None)

Source from the content-addressed store, hash-verified

148
149
150def make_https_server(case, *, context=None, certfile=CERTFILE,
151 host=HOST, handler_class=None):
152 if context is None:
153 context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
154 # We assume the certfile contains both private key and certificate
155 context.load_cert_chain(certfile)
156 server = HTTPSServerThread(context, host, handler_class)
157 flag = threading.Event()
158 server.start(flag)
159 flag.wait()
160 def cleanup():
161 if support.verbose:
162 sys.stdout.write('stopping HTTPS server\n')
163 server.stop()
164 if support.verbose:
165 sys.stdout.write('joining HTTPS thread\n')
166 server.join()
167 case.addCleanup(cleanup)
168 return server
169
170
171if __name__ == "__main__":

Callers 3

test_socketserverMethod · 0.90
make_serverMethod · 0.90
start_https_serverMethod · 0.90

Calls 5

startMethod · 0.95
waitMethod · 0.95
HTTPSServerThreadClass · 0.85
EventMethod · 0.80
addCleanupMethod · 0.80

Tested by 3

test_socketserverMethod · 0.72
make_serverMethod · 0.72
start_https_serverMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…