mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
MINOR: ssl/sample: adds ssl_bc_is_resumed fetch keyword.
Returns true when the back connection was made over an SSL/TLS transport layer and the newly created SSL session was resumed using a cached session or a TLS ticket.
This commit is contained in:
parent
eb8def9f34
commit
74f7ffa229
@ -14412,6 +14412,11 @@ ssl_bc_cipher : string
|
|||||||
Returns the name of the used cipher when the outgoing connection was made
|
Returns the name of the used cipher when the outgoing connection was made
|
||||||
over an SSL/TLS transport layer.
|
over an SSL/TLS transport layer.
|
||||||
|
|
||||||
|
ssl_bc_is_resumed : boolean
|
||||||
|
Returns true when the back connection was made over an SSL/TLS transport
|
||||||
|
layer and the newly created SSL session was resumed using a cached
|
||||||
|
session or a TLS ticket.
|
||||||
|
|
||||||
ssl_bc_protocol : string
|
ssl_bc_protocol : string
|
||||||
Returns the name of the used protocol when the outgoing connection was made
|
Returns the name of the used protocol when the outgoing connection was made
|
||||||
over an SSL/TLS transport layer.
|
over an SSL/TLS transport layer.
|
||||||
|
@ -6603,11 +6603,16 @@ smp_fetch_ssl_fc_has_sni(const struct arg *args, struct sample *smp, const char
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* boolean, returns true if client session has been resumed */
|
/* boolean, returns true if client session has been resumed.
|
||||||
|
* This function is also usable on backend conn if the fetch keyword 5th
|
||||||
|
* char is 'b'.
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
smp_fetch_ssl_fc_is_resumed(const struct arg *args, struct sample *smp, const char *kw, void *private)
|
smp_fetch_ssl_fc_is_resumed(const struct arg *args, struct sample *smp, const char *kw, void *private)
|
||||||
{
|
{
|
||||||
struct connection *conn = objt_conn(smp->sess->origin);
|
struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
|
||||||
|
smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
|
||||||
|
|
||||||
|
|
||||||
smp->data.type = SMP_T_BOOL;
|
smp->data.type = SMP_T_BOOL;
|
||||||
smp->data.u.sint = (conn && conn->xprt == &ssl_sock) &&
|
smp->data.u.sint = (conn && conn->xprt == &ssl_sock) &&
|
||||||
@ -8519,6 +8524,7 @@ static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, {
|
|||||||
{ "ssl_bc", smp_fetch_ssl_fc, 0, NULL, SMP_T_BOOL, SMP_USE_L5SRV },
|
{ "ssl_bc", smp_fetch_ssl_fc, 0, NULL, SMP_T_BOOL, SMP_USE_L5SRV },
|
||||||
{ "ssl_bc_alg_keysize", smp_fetch_ssl_fc_alg_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5SRV },
|
{ "ssl_bc_alg_keysize", smp_fetch_ssl_fc_alg_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5SRV },
|
||||||
{ "ssl_bc_cipher", smp_fetch_ssl_fc_cipher, 0, NULL, SMP_T_STR, SMP_USE_L5SRV },
|
{ "ssl_bc_cipher", smp_fetch_ssl_fc_cipher, 0, NULL, SMP_T_STR, SMP_USE_L5SRV },
|
||||||
|
{ "ssl_bc_is_resumed", smp_fetch_ssl_fc_is_resumed, 0, NULL, SMP_T_BOOL, SMP_USE_L5SRV },
|
||||||
{ "ssl_bc_protocol", smp_fetch_ssl_fc_protocol, 0, NULL, SMP_T_STR, SMP_USE_L5SRV },
|
{ "ssl_bc_protocol", smp_fetch_ssl_fc_protocol, 0, NULL, SMP_T_STR, SMP_USE_L5SRV },
|
||||||
{ "ssl_bc_unique_id", smp_fetch_ssl_fc_unique_id, 0, NULL, SMP_T_BIN, SMP_USE_L5SRV },
|
{ "ssl_bc_unique_id", smp_fetch_ssl_fc_unique_id, 0, NULL, SMP_T_BIN, SMP_USE_L5SRV },
|
||||||
{ "ssl_bc_use_keysize", smp_fetch_ssl_fc_use_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5SRV },
|
{ "ssl_bc_use_keysize", smp_fetch_ssl_fc_use_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5SRV },
|
||||||
|
Loading…
Reference in New Issue
Block a user