tcptls: Use new certificate upon sip reload

Previously, a TLS server socket would only be restarted upon sip reload if the
bind address had changed. This commit adds checking for changes to TLS
parameters like certificate, ciphers, etc. so they get picked up without
requiring a reload of the entire chan_sip module. This does not affect open
connections in any way, but new connections will use the new TLS parameters.
The changes also apply to HTTP and Manager.

ASTERISK-26604 #close

Change-Id: I169e86cefc6dcd627c915134015a6a1ab1aadbe6
This commit is contained in:
Michael Kuron
2016-11-15 20:44:13 +01:00
parent ee73af1d88
commit 8e77d6f520
2 changed files with 89 additions and 1 deletions

View File

@@ -106,6 +106,9 @@ struct ast_tls_config {
char *capath;
struct ast_flags flags;
SSL_CTX *ssl_ctx;
char certhash[41];
char pvthash[41];
char cahash[41];
};
/*! \page AstTlsOverview TLS Implementation Overview
@@ -150,6 +153,7 @@ struct ast_tcptls_session_args {
void (*periodic_fn)(void *);/*!< something we may want to run before after select on the accept socket */
void *(*worker_fn)(void *); /*!< the function in charge of doing the actual work */
const char *name;
struct ast_tls_config *old_tls_cfg; /*!< copy of the SSL configuration to determine whether changes have been made */
};
struct ast_tcptls_stream;