src/ssl_sock.c
static int
smp_fetch_ssl_f_version(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                           const struct arg *args, struct sample *smp)
{
	X509 *crt;

	if (!l4 || l4->si[0].conn->xprt != &ssl_sock)
		return 0;

	if (!(l4->si[0].conn->flags & CO_FL_CONNECTED)) {
		smp->flags |= SMP_F_MAY_CHANGE;
		return 0;
	}

	/* SSL_get_certificate returns a ptr on an SSL * internal sub struct */
	crt = SSL_get_certificate(l4->si[0].conn->xprt_ctx);
	if (!crt)
		return 0;

	smp->data.uint = (unsigned int)(1 + X509_get_version(crt));
	smp->type = SMP_T_UINT;

	return 1;
}
/* integer, returns the frontend certificate version */
integer, returns the frontend certificate version
integer returns the frontend certificate version
static int
smp_fetch_ssl_f_version(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                           const struct arg *args, struct sample *smp)
{
	X509 *crt;
	if (!l4 || l4->si[0].conn->xprt != &ssl_sock)
		return 0;
	if (!(l4->si[0].conn->flags & CO_FL_CONNECTED)) {
		smp->flags |= SMP_F_MAY_CHANGE;
		return 0;
	}
	crt = SSL_get_certificate(l4->si[0].conn->xprt_ctx);
	if (!crt)
		return 0;
	smp->data.uint = (unsigned int)(1 + X509_get_version(crt));
	smp->type = SMP_T_UINT;
	return 1;
}
static int smp_fetch_ssl_f_version ( struct proxy * px , struct session * l4 , void * l7 , unsigned int opt , const struct arg * args , struct sample * smp ) { X509 * crt ; if ( ! l4 || l4 -> si [ 0 ] . conn -> xprt != & ssl_sock ) return 0 ; if ( ! ( l4 -> si [ 0 ] . conn -> flags & CO_FL_CONNECTED ) ) { smp -> flags |= SMP_F_MAY_CHANGE ; return 0 ; } crt = SSL_get_certificate ( l4 -> si [ 0 ] . conn -> xprt_ctx ) ; if ( ! crt ) return 0 ; smp -> data . uint = ( unsigned int ) ( 1 + X509_get_version ( crt ) ) ; smp -> type = SMP_T_UINT ; return 1 ; }
integer, returns the frontend certificate version
integer returns the frontend certificate version
/* SSL_get_certificate returns a ptr on an SSL * internal sub struct */