]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: adds ssl_f_sha1 fetch to return frontend's certificate fingerprint
authorEmeric Brun <ebrun@exceliance.fr>
Wed, 30 Apr 2014 15:11:25 +0000 (17:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Apr 2014 20:31:11 +0000 (22:31 +0200)
ssl_f_sha1 is a binary binary fetch used to returns the SHA-1 fingerprint of
the certificate presented by the frontend when the incoming connection was
made over an SSL/TLS transport layer. This can be used to know which
certificate was chosen using SNI.

doc/configuration.txt
src/ssl_sock.c

index 0cfb819473113df83c5dbe07c2c95a49a2d2c156..8c2c0b035c5fcd7cc3278de19b89a86e96904e62 100644 (file)
@@ -10434,6 +10434,11 @@ ssl_f_serial : binary
   incoming connection was made over an SSL/TLS transport layer. When used for
   an ACL, the value(s) to match against can be passed in hexadecimal form.
 
+ssl_f_sha1 : binary
+  Returns the SHA-1 fingerprint of the certificate presented by the frontend
+  when the incoming connection was made over an SSL/TLS transport layer. This
+  can be used to know which certificate was chosen using SNI.
+
 ssl_f_sig_alg : string
   Returns the name of the algorithm used to sign the certificate presented by
   the frontend when the incoming connection was made over an SSL/TLS transport
index e88024d99cc53b64e3efe1bf8caa73f31d5915d6..19ede394520f7ea90423678404868e2b107f8052 100644 (file)
@@ -3435,6 +3435,7 @@ static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, {
        { "ssl_f_sig_alg",          smp_fetch_ssl_x_sig_alg,      0,                   NULL,    SMP_T_STR,  SMP_USE_L5CLI },
        { "ssl_f_s_dn",             smp_fetch_ssl_x_s_dn,         ARG2(0,STR,SINT),    NULL,    SMP_T_STR,  SMP_USE_L5CLI },
        { "ssl_f_serial",           smp_fetch_ssl_x_serial,       0,                   NULL,    SMP_T_BIN,  SMP_USE_L5CLI },
+       { "ssl_f_sha1",             smp_fetch_ssl_x_sha1,         0,                   NULL,    SMP_T_BIN,  SMP_USE_L5CLI },
        { "ssl_f_version",          smp_fetch_ssl_x_version,      0,                   NULL,    SMP_T_UINT, SMP_USE_L5CLI },
        { "ssl_fc",                 smp_fetch_ssl_fc,             0,                   NULL,    SMP_T_BOOL, SMP_USE_L5CLI },
        { "ssl_fc_alg_keysize",     smp_fetch_ssl_fc_alg_keysize, 0,                   NULL,    SMP_T_UINT, SMP_USE_L5CLI },