<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10395">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">http.c: Reload TLS even if http.conf hasn't changed<br><br>There is currently no way to indicate to Asterisk that TLS certificates<br>and/or keys have been updated other than by modifying http.conf or<br>restarting Asterisk.<br><br>There is already code in main/tcptls.c that determines if a reload is<br>actually necessary based on the hashes of the certicate and dependent<br>files, so this change merely gives us a way to request a reload without<br>explicitly modifying http.conf.<br><br>Change-Id: Ie795420dcc7eb3d91336820688a29adbcc321276<br>---<br>M main/http.c<br>1 file changed, 9 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/10395/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/http.c b/main/http.c</span><br><span>index 15c6da2..fec0ed8 100644</span><br><span>--- a/main/http.c</span><br><span>+++ b/main/http.c</span><br><span>@@ -2107,7 +2107,15 @@</span><br><span> int http_tls_was_enabled = 0;</span><br><span> </span><br><span> cfg = ast_config_load2("http.conf", "http", config_flags);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!cfg || cfg == CONFIG_STATUS_FILEUNCHANGED || cfg == CONFIG_STATUS_FILEINVALID) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!cfg || cfg == CONFIG_STATUS_FILEINVALID) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Even if the http.conf hasn't been updated, the TLS certs/keys may have been */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (cfg == CONFIG_STATUS_FILEUNCHANGED && reload && http_tls_cfg.enabled) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_ssl_setup(https_desc.tls_cfg)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_tcptls_server_start(&https_desc);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10395">change 10395</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10395"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ie795420dcc7eb3d91336820688a29adbcc321276 </div>
<div style="display:none"> Gerrit-Change-Number: 10395 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>