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

Class HTTPSServer

Lib/test/ssl_servers.py:21–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19# This one's based on HTTPServer, which is based on socketserver
20
21class HTTPSServer(_HTTPServer):
22
23 def __init__(self, server_address, handler_class, context):
24 _HTTPServer.__init__(self, server_address, handler_class)
25 self.context = context
26
27 def __str__(self):
28 return ('<%s %s:%s>' %
29 (self.__class__.__name__,
30 self.server_name,
31 self.server_port))
32
33 def get_request(self):
34 # override this to wrap socket with SSL
35 try:
36 sock, addr = self.socket.accept()
37 sslconn = self.context.wrap_socket(sock, server_side=True)
38 except OSError as e:
39 # socket errors are silenced by the caller, print them here
40 if support.verbose:
41 sys.stderr.write("Got an error:\n%s\n" % e)
42 raise
43 return sslconn, addr
44
45class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
46 # need to override translate_path to get a known root,

Callers 3

create_https_serverFunction · 0.90
__init__Method · 0.70
ssl_servers.pyFile · 0.70

Calls

no outgoing calls

Tested by 1

create_https_serverFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…