bneradt commented on code in PR #13342:
URL: https://github.com/apache/trafficserver/pull/13342#discussion_r3572338843


##########
src/iocore/net/SSLUtils.cc:
##########
@@ -1733,6 +1733,27 @@ SSLMultiCertConfigLoader::update_ssl_ctx(const 
std::string &secret_name)
       if (!ctx) {
         retval = false;
       } else {
+        if ((*policy_iter)->addr) {
+          SSLCertContext *cc = nullptr;
+          if (strcmp((*policy_iter)->addr, "*") == 0) {
+            this->_set_handshake_callbacks(ctx.get());
+            cc = lookup->find("*", loadingctx.ctx_type);
+          } else {
+            IpEndpoint ep;
+            if (ats_ip_pton((*policy_iter)->addr, &ep) == 0) {
+              cc = lookup->find(ep, loadingctx.ctx_type);
+            } else {
+              Error("'%s' is not a valid IPv4 or IPv6 address", (const char 
*)(*policy_iter)->addr);
+              retval = false;
+            }
+          }
+          if (cc && cc->userconfig.get() == policy_iter->get()) {
+            cc->setCtx(ctx);
+          }
+          if (strcmp((*policy_iter)->addr, "*") == 0) {
+            lookup->setDefaultContext(ctx);
+          }

Review Comment:
   Fixed. setDefaultContext() is now gated by the same userconfig ownership 
check as the active "*" lookup entry. The AuTest now includes a shadowed 
wildcard policy and verifies that refreshing its secret does not replace the 
no-SNI default certificate.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to