aboutsummaryrefslogtreecommitdiffstats
path: root/main/manager.c
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-24 21:22:31 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-24 21:22:31 +0000
commit1d52218463e22303625d0f3c66830698a385358d (patch)
treec2829c1079c16807c9e5e9958eb3fdf96d9a25f6 /main/manager.c
parentbaf54d0843e1a130dd442bd10416af0fb605c945 (diff)
TLS/SSL private key option
Adds option to specify a private key .pem file when configuring TLS or SSL in AMI, HTTP, and SIP. Before this, the certificate file was used for both the public and private key. It is possible for this file to hold both, but most configurations allow for a separate private key file to be specified. Clarified in .conf files how these options are to be used. The current conf files do not explain how the private key is handled at all, so without knowledge of Asterisk's TLS implementation, it would be hard to know for sure what was going on or how to set it up. Review: http://reviewboard.digium.com/r/234/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190545 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/manager.c b/main/manager.c
index 8a054b89b..09e3c764c 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -4791,6 +4791,10 @@ static int __init_manager(int reload)
ast_free(ami_tls_cfg.certfile);
}
ami_tls_cfg.certfile = ast_strdup(AST_CERTFILE);
+ if (ami_tls_cfg.pvtfile) {
+ ast_free(ami_tls_cfg.pvtfile);
+ }
+ ami_tls_cfg.pvtfile = ast_strdup("");
if (ami_tls_cfg.cipher) {
ast_free(ami_tls_cfg.cipher);
}
@@ -4812,6 +4816,9 @@ static int __init_manager(int reload)
} else if (!strcasecmp(var->name, "sslcert")) {
ast_free(ami_tls_cfg.certfile);
ami_tls_cfg.certfile = ast_strdup(val);
+ } else if (!strcasecmp(var->name, "sslprivatekey")) {
+ ast_free(ami_tls_cfg.pvtfile);
+ ami_tls_cfg.pvtfile = ast_strdup(val);
} else if (!strcasecmp(var->name, "sslcipher")) {
ast_free(ami_tls_cfg.cipher);
ami_tls_cfg.cipher = ast_strdup(val);