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

Function default_ssl_context_factory

gunicorn/sock.py:268–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267def ssl_context(conf):
268 def default_ssl_context_factory():
269 context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH, cafile=conf.ca_certs)
270 context.load_cert_chain(certfile=conf.certfile, keyfile=conf.keyfile)
271 context.verify_mode = conf.cert_reqs
272 if conf.ciphers:
273 context.set_ciphers(conf.ciphers)
274
275 # Configure ALPN for HTTP/2 if enabled
276 alpn_protocols = _get_alpn_protocols(conf)
277 if alpn_protocols:
278 context.set_alpn_protocols(alpn_protocols)
279
280 return context
281
282 return conf.ssl_context(conf, default_ssl_context_factory)
283

Callers 3

ssl_contextMethod · 0.85
ssl_contextFunction · 0.85
sni_callbackFunction · 0.85

Calls 1

_get_alpn_protocolsFunction · 0.85

Tested by

no test coverage detected