MINOR: connection: add proxy-v2-options authority
This patch add option PP2_TYPE_AUTHORITY to proxy protocol v2 when a TLS
connection was negotiated. In this case, authority corresponds to the sni.
diff --git a/src/connection.c b/src/connection.c
index e8a02ea..206b22b 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1044,6 +1044,15 @@
}
#ifdef USE_OPENSSL
+ if (srv->pp_opts & SRV_PP_V2_AUTHORITY) {
+ value = ssl_sock_get_sni(remote);
+ if (value) {
+ if ((buf_len - ret) < sizeof(struct tlv))
+ return 0;
+ ret += make_tlv(&buf[ret], (buf_len - ret), PP2_TYPE_AUTHORITY, strlen(value), value);
+ }
+ }
+
if (srv->pp_opts & SRV_PP_V2_SSL) {
struct tlv_ssl *tlv;
int ssl_tlv_len = 0;