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

Function ssl_context

gunicorn/sock.py:267–282  ·  view source on GitHub ↗
(conf)

Source from the content-addressed store, hash-verified

265
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
284
285def ssl_wrap_socket(sock, conf):

Callers 3

runMethod · 0.90
runMethod · 0.90
ssl_wrap_socketFunction · 0.70

Calls 1

ssl_contextMethod · 0.80

Tested by

no test coverage detected