tcptls: Prevent unsupported options from being set

AMI, HTTP, and chan_sip all support TLS in some way, but none of them
support all the options that Asterisk's TLS core is capable of
interpreting. This prevents consumers of the TLS/SSL layer from setting
TLS/SSL options that they do not support.

This also gets tlsverifyclient closer to a working state by requesting
the client certificate when tlsverifyclient is set. Currently, there is
no consumer of main/tcptls.c in Asterisk that supports this feature and
so it can not be properly tested.

Review: https://reviewboard.asterisk.org/r/2370/
Reported-by: John Bigelow
Patch-by: Kinsey Moore
(closes issue AST-1093)
........

Merged revisions 383165 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 383166 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2013-03-15 12:53:03 +00:00
parent cacc356bbe
commit ad5f3a5759
4 changed files with 30 additions and 5 deletions

View File

@@ -31646,8 +31646,11 @@ static int reload_config(enum channelreloadreason reason)
continue;
}
/* handle tls conf */
if (!ast_tls_read_conf(&default_tls_cfg, &sip_tls_desc, v->name, v->value)) {
/* handle tls conf, don't allow setting of tlsverifyclient as it isn't supported by chan_sip */
if (!strcasecmp(v->name, "tlsverifyclient")) {
ast_log(LOG_WARNING, "Ignoring unsupported option 'tlsverifyclient'\n");
continue;
} else if (!ast_tls_read_conf(&default_tls_cfg, &sip_tls_desc, v->name, v->value)) {
continue;
}