Software /
code /
prosody
Comparison
core/certmanager.lua @ 2628:04958fb28c44
certmanager, hostmanager: Rename get_context() to create_context() to be more explicit about what it does
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 13 Feb 2010 16:08:43 +0000 |
parent | 2564:6b4fe320a6ea |
child | 2631:77f135c7689a |
comparison
equal
deleted
inserted
replaced
2627:ce5b5d7f87c3 | 2628:04958fb28c44 |
---|---|
16 local default_ssl_ctx_in_mt = { __index = default_ssl_ctx_in }; | 16 local default_ssl_ctx_in_mt = { __index = default_ssl_ctx_in }; |
17 | 17 |
18 -- Global SSL options if not overridden per-host | 18 -- Global SSL options if not overridden per-host |
19 local default_ssl_config = configmanager.get("*", "core", "ssl"); | 19 local default_ssl_config = configmanager.get("*", "core", "ssl"); |
20 | 20 |
21 function get_context(host, mode, config) | 21 function create_context(host, mode, config) |
22 local ssl_config = config and config.core.ssl or default_ssl_config; | 22 local ssl_config = config and config.core.ssl or default_ssl_config; |
23 if ssl and ssl_config then | 23 if ssl and ssl_config then |
24 return ssl_newcontext(setmetatable(ssl_config, mode == "client" and default_ssl_ctx_mt or default_ssl_ctx_in_mt)); | 24 return ssl_newcontext(setmetatable(ssl_config, mode == "client" and default_ssl_ctx_mt or default_ssl_ctx_in_mt)); |
25 end | 25 end |
26 return nil; | 26 return nil; |