src/ssl_sock.c
static int
smp_fetch_ssl_fc_has_sni(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                         const struct arg *args, struct sample *smp)
{
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
	smp->type = SMP_T_BOOL;
	smp->data.uint = (l4->si[0].conn->xprt == &ssl_sock) &&
		l4->si[0].conn->xprt_ctx &&
		SSL_get_servername(l4->si[0].conn->xprt_ctx, TLSEXT_NAMETYPE_host_name) != NULL;
	return 1;
#else
	return 0;
#endif
}
/* boolean, returns true if client present a SNI */
boolean, returns true if client present a SNI
boolean returns true if client present a SNI
static int
smp_fetch_ssl_fc_has_sni(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                         const struct arg *args, struct sample *smp)
{
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
	smp->type = SMP_T_BOOL;
	smp->data.uint = (l4->si[0].conn->xprt == &ssl_sock) &&
		l4->si[0].conn->xprt_ctx &&
		SSL_get_servername(l4->si[0].conn->xprt_ctx, TLSEXT_NAMETYPE_host_name) != NULL;
	return 1;
#else
	return 0;
#endif
}
static int smp_fetch_ssl_fc_has_sni ( struct proxy * px , struct session * l4 , void * l7 , unsigned int opt , const struct arg * args , struct sample * smp ) { #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME smp -> type = SMP_T_BOOL ; smp -> data . uint = ( l4 -> si [ 0 ] . conn -> xprt == & ssl_sock ) && l4 -> si [ 0 ] . conn -> xprt_ctx && SSL_get_servername ( l4 -> si [ 0 ] . conn -> xprt_ctx , TLSEXT_NAMETYPE_host_name ) != NULL ; return 1 ; #else return 0 ; #endif }
boolean, returns true if client present a SNI
boolean returns true if client present a SNI