<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10398">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
George Joseph: Approved for Submit
</div><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;"><span>diff --git a/main/http.c b/main/http.c</span><br><span>index 5d0b89e..dcf90ae 100644</span><br><span>--- a/main/http.c</span><br><span>+++ b/main/http.c</span><br><span>@@ -2066,7 +2066,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) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (http_tls_cfg.enabled && 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/10398">change 10398</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/10398"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ie795420dcc7eb3d91336820688a29adbcc321276 </div>
<div style="display:none"> Gerrit-Change-Number: 10398 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>