MCPcopy
hub / github.com/benoitc/gunicorn / sni_callback

Function sni_callback

examples/example_config.py:236–240  ·  view source on GitHub ↗
(socket, server_hostname, context)

Source from the content-addressed store, hash-verified

234 # Server can also return different server certificate depending which
235 # hostname the client uses. Requires Python 3.7 or later.
236 def sni_callback(socket, server_hostname, context):
237 if server_hostname == "foo.127.0.0.1.nip.io":
238 new_context = default_ssl_context_factory()
239 new_context.load_cert_chain(certfile="foo.pem", keyfile="foo-key.pem")
240 socket.context = new_context
241
242 context.sni_callback = sni_callback
243

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected