TSVCONNPR...LE/DISABLE(3ts)
π TSVConnProtocolEnable/Disable β the TSVConnProtocol API function β¨
okay bestie, so this is the page for TSVConnProtocolEnable and TSVConnProtocolDisable from Apache Traffic Server π β two little functions that let you boss around which protocols get advertised during TLS protocol negotiation. no cap.
πΈ SYNOPSIS πΈ
#include <ts/ts.h>
TSReturnCode TSVConnProtocolEnable(TSVConn vconn, const char *protocol)
TSReturnCode TSVConnProtocolDisable(TSVConn vconn, const char *protocol)
π¦ DESCRIPTION π¦
so, TSVConnProtocolEnable() turns on the protocol you pass in as protocol, so it gets advertised in the TLS protocol negotiation. it's giving "yes bestie, we support this, put it on the menu" π
and TSVConnProtocolDisable() is the reverse β it takes the protocol named by protocol right out of the TLS protocol negotiation. gone. not invited to the party. π
π«Ά IMPORTANT VIBE CHECK: for these calls to actually do anything, you have to make them from the early TLS negotiation hooks β likeTS_SSL_CLIENT_HELLO_HOOKorTS_SSL_SERVERNAME_HOOK. do it too late and it's giving "too late, the door's already closed" π timing is literally everything here.
β EXAMPLES β
this next bit is excerpted from example/plugins/c-api/disable_http2/disable_http2.cc in the Traffic Server source distribution π. it shows how you'd use TSVConnProtocolDisable() inside a plugin called from the TS_SSL_SERVERNAME_HOOK. look at her go π₯
int
CB_SNI(TSCont contp, TSEvent, void *cb_data)
{
auto vc = static_cast<TSVConn>(cb_data);
TSSslConnection ssl_conn = TSVConnSslConnectionGet(vc);
auto *ssl = reinterpret_cast<SSL *>(ssl_conn);
char const *sni = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
if (sni) {
if (Domains.find(sni) != Domains.end()) {
TSDebug(PLUGIN_NAME, "Disable H2 for SNI=%s", sni);
TSVConnProtocolDisable(vc, TS_ALPN_PROTOCOL_HTTP_2_0);
}
}
π COPYRIGHT π
2026, dev@trafficserver.apache.org π
and that's the whole page, bestie π§ β Apache Traffic Server, version 9.2, dated Feb 12, 2026. go forth and negotiate those protocols responsibly. periodt. πβ¨
π¦ where this page comes from
- ubuntu noble: trafficserver-dev 9.2.3+ds-1+deb12u1ubuntu0.1 Β· Apache-2.0
- ubuntu questing: trafficserver-dev 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms