.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "TSVCONNPROTOCOLENABLE/DISABLE" "3ts" "Nov 02, 2023" "9.2" "Apache Traffic Server" .SH NAME TSVConnProtocolEnable/Disable \- TSVConnProtocol API function .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #include .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%TSReturnCode\fP TSVConnProtocolEnable(\fI\%TSVConn\fP vconn, const char *protocol) .UNINDENT .INDENT 0.0 .TP .B \fI\%TSReturnCode\fP TSVConnProtocolDisable(\fI\%TSVConn\fP vconn, const char *protocol) .UNINDENT .SH DESCRIPTION .sp \fI\%TSVConnProtocolEnable()\fP will enable the protocol specified by \fIprotocol\fP to be advertised in the TLS protocol negotiation. .sp Similarly, \fI\%TSVConnProtocolDisable()\fP will remove the protocol specified by \fIprotocol\fP from the TLS protocol negotiation. .sp To be effective, these calls must be made from the early TLS negotiation hooks like \fI\%TS_SSL_CLIENT_HELLO_HOOK\fP or \fI\%TS_SSL_SERVERNAME_HOOK\fP\&. .SH EXAMPLES .sp The example below is excerpted from \fIexample/plugins/c\-api/disable_http2/disable_http2.cc\fP in the Traffic Server source distribution. It shows how the \fI\%TSVConnProtocolDisable()\fP function can be used in a plugin called from the \fI\%TS_SSL_SERVERNAME_HOOK\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C int CB_SNI(TSCont contp, TSEvent, void *cb_data) { auto vc = static_cast(cb_data); TSSslConnection ssl_conn = TSVConnSslConnectionGet(vc); auto *ssl = reinterpret_cast(ssl_conn); char const *sni = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name); if (sni) { if (Domains.find(sni) != Domains.end()) { TSDebug(PLUGIN_NAME, \(dqDisable H2 for SNI=%s\(dq, sni); TSVConnProtocolDisable(vc, TS_ALPN_PROTOCOL_HTTP_2_0); } } .ft P .fi .UNINDENT .UNINDENT .SH COPYRIGHT 2023, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .