The TSProtoSet functions ( https://docs.trafficserver.apache.org/en/latest/developer-guide/api/functions/TSProtoSet.en.html) were created for tls_proto, our early plugin to disable HTTP/2 on a per connection basis. Since then, this HTTP/2 disable logic has been absorbed into the core via the sni.yaml, and with PR #5769 the underlying support for protocol enabling and disabling is simplified. There, I propose replacing the existing TSProtoSet InkAPI calls with a slimmed down interface.
In the current InkAPI, to disable HTTP/2 for a SSL connection that has HTTP/2 enabled by default, the plugin would make the following calls. TSAcceptor acceptor = TSAcceptorGet(sslp) TSNextProtocolSet set = TSGetcloneProtoSet(acceptor) set = TSUnregisterProtocol(set, "http/2") TSRegisterProtocol(sslp, set) Instead I propose the following pair of functions TSReturnCode TSVConnProtocolEnable(TSVConn connp, const char *protocol_name) TSReturnCode TSVConnProtocolDisable(TSVConn connp, const char *protocol_name) If TSVConn is a SSLNetVC, then the alpn/npn string will be adjusted to add/remove the specified protocol. If the protocol name is not registered, the function will return TSError. If the TSVConn is a UnixNetVC, the functions will do nothing and return success. In the future for HTTP/3, the functions could add/remove the protocols for however protocols are advertised for HTTP/3 or QUIC.