You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "ywkaras (via GitHub)" <gi...@apache.org> on 2023/05/10 03:17:43 UTC
[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9667: Add new settings to specify TLS versions to use
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org