ywkaras commented on code in PR #9667:
URL: https://github.com/apache/trafficserver/pull/9667#discussion_r1189317751


##########
iocore/net/P_SNIActionPerformer.h:
##########
@@ -341,15 +343,25 @@ class TLSValidProtocols : public ActionItem
 #endif
   TLSValidProtocols() : protocol_mask(max_mask) {}
   TLSValidProtocols(unsigned long protocols) : unset(false), 
protocol_mask(protocols) {}
+  TLSValidProtocols(int min_ver, int max_ver) : unset(false), 
protocol_mask(0), min_ver(min_ver), max_ver(max_ver) {}
 
   int
   SNIAction(TLSSNISupport *snis, const Context & /* ctx */) const override
   {
-    if (!unset) {
-      auto ssl_vc            = dynamic_cast<SSLNetVConnection *>(snis);
+    if (this->min_ver >= 0 || this->max_ver >= 0) {
       const char *servername = snis->get_sni_server_name();
-      Debug("ssl_sni", "TLSValidProtocol param 0%x, fqdn [%s]", 
static_cast<unsigned int>(this->protocol_mask), servername);
-      ssl_vc->set_valid_tls_protocols(protocol_mask, 
TLSValidProtocols::max_mask);
+      Debug("ssl_sni", "TLSValidProtocol min=%d, max=%d, fqdn [%s]", 
this->min_ver, this->max_ver, servername);
+      auto ssl_vc = dynamic_cast<SSLNetVConnection *>(snis);
+      ssl_vc->set_valid_tls_version_min(this->min_ver);
+      ssl_vc->set_valid_tls_version_max(this->max_ver);
+    } else {

Review Comment:
   Why not `} else if (!unset) {` ?



-- 
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