Skip to content

Commit e062483

Browse files
author
HAProxy Community
committed
Update docs for dev
1 parent 1b9266a commit e062483

File tree

3 files changed

+153
-32
lines changed

3 files changed

+153
-32
lines changed

docs/dev/configuration.html

Lines changed: 113 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>HAProxy version 3.3-dev9-47 - Configuration Manual</title>
5+
<title>HAProxy version 3.3-dev9-60 - Configuration Manual</title>
66
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
77
<link href="https://raw.githubusercontent.com/thomaspark/bootswatch/v3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" />
88
<link href="../css/page.css?0.4.2-15" rel="stylesheet" />
@@ -2272,12 +2272,16 @@
22722272

22732273
<a class="list-group-item" href="#json_query">json_query</a>
22742274

2275+
<a class="list-group-item" href="#jwt">jwt</a>
2276+
22752277
<a class="list-group-item" href="#jwt_header_query">jwt_header_query</a>
22762278

22772279
<a class="list-group-item" href="#jwt_payload_query">jwt_payload_query</a>
22782280

22792281
<a class="list-group-item" href="#jwt_verify">jwt_verify</a>
22802282

2283+
<a class="list-group-item" href="#jwt_verify_cert">jwt_verify_cert</a>
2284+
22812285
</div> <!-- /letter -->
22822286
<div class="letter" id="letter-K"><h4>K</h4>
22832287

@@ -4625,7 +4629,7 @@
46254629
You can use <strong>left</strong> and <strong>right</strong> arrow keys to navigate between chapters.<br>
46264630
</p>
46274631
<p class="text-right">
4628-
<small>Converted with <a href="https://github.com/cbonte/haproxy-dconv">haproxy-dconv</a> v<b>0.4.2-15</b> on <b>2025/10/08</b></small>
4632+
<small>Converted with <a href="https://github.com/cbonte/haproxy-dconv">haproxy-dconv</a> v<b>0.4.2-15</b> on <b>2025/10/13</b></small>
46294633
</p>
46304634
</div>
46314635
<!-- /.sidebar -->
@@ -4636,7 +4640,7 @@
46364640
<div class="text-center">
46374641
<h1><a href="http://www.haproxy.org/" title="HAProxy"><img src="../img/HAProxyCommunityEdition_60px.png?0.4.2-15" /></a></h1>
46384642
<h2>Configuration Manual</h2>
4639-
<p><strong>version 3.3-dev9-47</strong></p>
4643+
<p><strong>version 3.3-dev9-60</strong></p>
46404644
<p>
46414645
2025/10/03<br>
46424646

@@ -24136,6 +24140,7 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2413624140
<tr><td ><a href="#7-jwt_header_query">jwt_header_query([json_path[,output_type]])</a></td><td >string</td><td >string</td></tr>
2413724141
<tr><td ><a href="#7-jwt_payload_query">jwt_payload_query([json_path[,output_type]])</a></td><td >string</td><td >string</td></tr>
2413824142
<tr><td ><a href="#7-jwt_verify">jwt_verify(alg,key)</a></td><td >string</td><td >integer</td></tr>
24143+
<tr><td ><a href="#7-jwt_verify_cert">jwt_verify_cert(alg,cert)</a></td><td >string</td><td >integer</td></tr>
2413924144
<tr><td ><a href="#7-language">language(value[,default])</a></td><td >string</td><td >string</td></tr>
2414024145
<tr><td ><a href="#7-length">length</a></td><td >string</td><td >integer</td></tr>
2414124146
<tr><td ><a href="#7-lower">lower</a></td><td >string</td><td >string</td></tr>
@@ -24150,8 +24155,8 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2415024155
<tr><td ><a href="#7-ms_ltime">ms_ltime(format[,offset])</a></td><td >integer</td><td >string</td></tr>
2415124156
<tr><td ><a href="#7-ms_utime">ms_utime(format[,offset])</a></td><td >integer</td><td >string</td></tr>
2415224157
<tr><td ><a href="#7-mul">mul(value)</a></td><td >integer</td><td >integer</td></tr>
24153-
<tr><td ><a href="#7-nbsrv">nbsrv</a></td><td >string</td><td >integer</td></tr>
2415424158
<thead><tr><th>keyword</th><th>input type</th><th>output type</th></tr></thead>
24159+
<tr><td ><a href="#7-nbsrv">nbsrv</a></td><td >string</td><td >integer</td></tr>
2415524160
<tr><td ><a href="#7-neg">neg</a></td><td >integer</td><td >integer</td></tr>
2415624161
<tr><td ><a href="#7-not">not</a></td><td >integer</td><td >boolean</td></tr>
2415724162
<tr><td ><a href="#7-odd">odd</a></td><td >integer</td><td >boolean</td></tr>
@@ -24171,8 +24176,8 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2417124176
<tr><td ><a href="#7-secure_memcmp">secure_memcmp(var)</a></td><td >string</td><td >boolean</td></tr>
2417224177
<tr><td ><a href="#7-set-var">set-var(var[,cond...])</a></td><td >any</td><td >same</td></tr>
2417324178
<tr><td ><a href="#7-sha1">sha1</a></td><td >binary</td><td >binary</td></tr>
24174-
<tr><td ><a href="#7-sha2">sha2([bits])</a></td><td >binary</td><td >binary</td></tr>
2417524179
<thead><tr><th>keyword</th><th>input type</th><th>output type</th></tr></thead>
24180+
<tr><td ><a href="#7-sha2">sha2([bits])</a></td><td >binary</td><td >binary</td></tr>
2417624181
<tr><td ><a href="#7-srv_is_up">srv_is_up</a></td><td >string</td><td >boolean</td></tr>
2417724182
<tr><td ><a href="#7-srv_queue">srv_queue</a></td><td >string</td><td >integer</td></tr>
2417824183
<tr><td ><a href="#7-strcmp">strcmp(var)</a></td><td >string</td><td >boolean</td></tr>
@@ -24192,8 +24197,8 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2419224197
<tr><td ><a href="#7-table_gpc0">table_gpc0([table])</a></td><td >any</td><td >integer</td></tr>
2419324198
<tr><td ><a href="#7-table_gpc0_rate">table_gpc0_rate([table])</a></td><td >any</td><td >integer</td></tr>
2419424199
<tr><td ><a href="#7-table_gpc1">table_gpc1([table])</a></td><td >any</td><td >integer</td></tr>
24195-
<tr><td ><a href="#7-table_gpc1_rate">table_gpc1_rate([table])</a></td><td >any</td><td >integer</td></tr>
2419624200
<thead><tr><th>keyword</th><th>input type</th><th>output type</th></tr></thead>
24201+
<tr><td ><a href="#7-table_gpc1_rate">table_gpc1_rate([table])</a></td><td >any</td><td >integer</td></tr>
2419724202
<tr><td ><a href="#7-table_gpc_rate">table_gpc_rate(idx[,table])</a></td><td >any</td><td >integer</td></tr>
2419824203
<tr><td ><a href="#7-table_gpt">table_gpt(idx[,table])</a></td><td >any</td><td >integer</td></tr>
2419924204
<tr><td ><a href="#7-table_gpt0">table_gpt0([table])</a></td><td >any</td><td >integer</td></tr>
@@ -24213,8 +24218,8 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2421324218
<tr><td ><a href="#7-table_sess_cnt">table_sess_cnt([table])</a></td><td >any</td><td >integer</td></tr>
2421424219
<tr><td ><a href="#7-table_sess_rate">table_sess_rate([table])</a></td><td >any</td><td >integer</td></tr>
2421524220
<tr><td ><a href="#7-table_trackers">table_trackers([table])</a></td><td >any</td><td >integer</td></tr>
24216-
<tr><td ><a href="#7-ub64dec">ub64dec</a></td><td >string</td><td >string</td></tr>
2421724221
<thead><tr><th>keyword</th><th>input type</th><th>output type</th></tr></thead>
24222+
<tr><td ><a href="#7-ub64dec">ub64dec</a></td><td >string</td><td >string</td></tr>
2421824223
<tr><td ><a href="#7-ub64enc">ub64enc</a></td><td >string</td><td >string</td></tr>
2421924224
<tr><td ><a href="#7-ungrpc">ungrpc(field_number[,field_type])</a></td><td >binary</td><td >binary / int</td></tr>
2422024225
<tr><td ><a href="#7-unset-var">unset-var(var)</a></td><td >any</td><td >same</td></tr>
@@ -24740,24 +24745,103 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2474024745
+--------------+---------------------------------------------------------+
2474124746

2474224747
- &lt;key&gt; can be either a string or a variable name (See also &quot;<span class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">set-var<span class="caret"></span></a><ul class="dropdown-menu"><li class="dropdown-header">This keyword is available in sections :</li><li><a href="#set-var%20%28Process%20management%20and%20security%29">Process management and security</a></li><li><a href="#set-var%20%28Alphabetically%20sorted%20actions%20reference%29">Alphabetically sorted actions reference</a></li><li><a href="#set-var%20%28Converters%29">Converters</a></li></ul></span>&quot;) that
24743-
holds a secret, a public key path or a certificate path.
24748+
holds a secret or a public key path.
2474424749

2474524750
Secrets are only applicable when using HMAC algorithms.
2474624751

2474724752
Public keys must be in either the PKCS#1 format (for RSA keys, starting
2474824753
with BEGIN RSA PUBLIC KEY) or SPKI format (Subject Public Key Info,
2474924754
starting with BEGIN PUBLIC KEY). Public keys must be available during the
24750-
configuration parsing and cannot be updated or loaded at runtime unlike
24755+
configuration parsing and cannot be updated or loaded at runtime. See
24756+
&quot;<a href="#jwt_verify_cert">jwt_verify_cert</a>&quot; converter for JWT token validation based on full-on PEM
2475124757
certificates.
2475224758

24753-
Certificates must be standard PEM certificates (starting with BEGIN
24754-
CERTIFICATE). When using a certificate its path can be passed directly to
24755-
the converter or referenced via a variable. Certificates can be either
24756-
declared in a crt-store, or dynamically loaded via the stats socket.
24759+
All the public keys that might be used to verify JWTs must be known during
24760+
init in order to be added into a dedicated cache so that no disk access is
24761+
required during runtime.
2475724762

24758-
All the public keys and certificates that might be used to verify JWTs must
24759-
be known during init in order to be added into a dedicated cache so that no
24760-
disk access is required during runtime.
24763+
Returns 1 in case of verification success, 0 in case of verification failure
24764+
and a strictly negative value for any other error. Because of all those
24765+
non-null error return values, the result of this converter should never be
24766+
converted to a boolean. See below for a full list of the possible return
24767+
values.
24768+
24769+
The possible return values are the following :
24770+
24771+
+----+----------------------------------------------------------------------+
24772+
| ID | message |
24773+
+----+----------------------------------------------------------------------+
24774+
| 1 | &quot;Verification success&quot; |
24775+
| 0 | &quot;Verification failure&quot; |
24776+
| -1 | &quot;Unknown algorithm (not mentioned in RFC7518)&quot; |
24777+
| -2 | &quot;Unmanaged algorithm&quot; |
24778+
| -3 | &quot;Invalid token&quot; |
24779+
| -4 | &quot;Out of memory&quot; |
24780+
| -5 | &quot;Unknown pubkey/certificate&quot; |
24781+
| -6 | &quot;Internal error&quot; |
24782+
+----+----------------------------------------------------------------------+
24783+
24784+
Please note that this converter is only available when HAProxy has been
24785+
compiled with USE_OPENSSL.
24786+
</pre><div class="separator">
24787+
<span class="label label-success">Example:</span>
24788+
<pre class="prettyprint">
24789+
<code><span class="comment"># Get a JWT from the authorization header, extract the &quot;alg&quot; field of its</span>
24790+
<span class="comment"># JOSE header and use a public key to verify a signature</span>
24791+
http-request set-var(txn.bearer) http_auth_bearer
24792+
http-request set-var(txn.jwt_alg) var(txn.bearer),jwt_header_query('$.alg')
24793+
http-request deny unless { var(txn.jwt_alg) -m str &quot;RS256&quot; }
24794+
http-request deny unless { var(txn.bearer),jwt_verify(txn.jwt_alg,&quot;/path/to/pubkey.pem&quot;) 1 }
24795+
</code></pre>
24796+
</div><a class="anchor" name="jwt_verify_cert"></a><a class="anchor" name="7-jwt_verify_cert"></a><a class="anchor" name="7.3.1-jwt_verify_cert"></a><a class="anchor" name="jwt_verify_cert (Using ACLs and fetching samples)"></a><a class="anchor" name="jwt_verify_cert (Converters)"></a><div class="keyword"><b><a class="anchor" name="jwt_verify_cert"></a><a href="#7.3.1-jwt_verify_cert">jwt_verify_cert</a></b>(<span style="color: #080">&lt;alg&gt;</span>,<span style="color: #080">&lt;cert&gt;</span>)</div><pre class="text">Performs a signature verification for the JSON Web Token (JWT) given in input
24797+
by using the &lt;alg&gt; algorithm and the &lt;cert&gt; parameter.
24798+
For now, only JWS tokens using the Compact Serialization format can be
24799+
processed (three dot-separated base64-url encoded strings).
24800+
This converter only verifies the signature of the token and does not perform
24801+
a full JWT validation as specified in <a href="#7.2">section 7.2</a> of RFC7519. We do not
24802+
ensure that the header and payload contents are fully valid JSONs once
24803+
decoded for instance, and no checks are performed regarding their respective
24804+
contents.
24805+
24806+
- &lt;alg&gt; can be either a string or a variable name (See also &quot;<span class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">set-var<span class="caret"></span></a><ul class="dropdown-menu"><li class="dropdown-header">This keyword is available in sections :</li><li><a href="#set-var%20%28Process%20management%20and%20security%29">Process management and security</a></li><li><a href="#set-var%20%28Alphabetically%20sorted%20actions%20reference%29">Alphabetically sorted actions reference</a></li><li><a href="#set-var%20%28Converters%29">Converters</a></li></ul></span>&quot;) that
24807+
holds the name of the algorithm used to verify. Unlike the &quot;<a href="#jwt_verify">jwt_verify</a>&quot;
24808+
converter, this converter only expects a certificate as second parameter so
24809+
it should not be used for tokens using HMAC algorithms.
24810+
24811+
Algorithms mentioned in <a href="#3.1">section 3.1</a> of RFC7518 are managed (apart from HMAC
24812+
ones):
24813+
24814+
+--------------+---------------------------------------------------------+
24815+
| &quot;alg&quot; Param | Digital Signature or MAC Algorithm |
24816+
| Value | |
24817+
+--------------+---------------------------------------------------------+
24818+
| RS256 | RSASSA-PKCS1-v1_5 using SHA-256 |
24819+
| RS384 | RSASSA-PKCS1-v1_5 using SHA-384 |
24820+
| RS512 | RSASSA-PKCS1-v1_5 using SHA-512 |
24821+
| ES256 | ECDSA using P-256 and SHA-256 |
24822+
| ES384 | ECDSA using P-384 and SHA-384 |
24823+
| ES512 | ECDSA using P-521 and SHA-512 |
24824+
| PS256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 |
24825+
| PS384 | RSASSA-PSS using SHA-384 and MGF1 with SHA-384 |
24826+
| PS512 | RSASSA-PSS using SHA-512 and MGF1 with SHA-512 |
24827+
| none | No digital signature or MAC performed |
24828+
+--------------+---------------------------------------------------------+
24829+
24830+
- &lt;key&gt; can be either a string or a variable name (See also &quot;<span class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">set-var<span class="caret"></span></a><ul class="dropdown-menu"><li class="dropdown-header">This keyword is available in sections :</li><li><a href="#set-var%20%28Process%20management%20and%20security%29">Process management and security</a></li><li><a href="#set-var%20%28Alphabetically%20sorted%20actions%20reference%29">Alphabetically sorted actions reference</a></li><li><a href="#set-var%20%28Converters%29">Converters</a></li></ul></span>&quot;) that
24831+
holds a certificate path.
24832+
24833+
Certificates must be standard PEM certificates (starting with BEGIN
24834+
CERTIFICATE). Their path can be passed directly to the converter or
24835+
referenced via a variable. If a variable is used, the corresponding
24836+
certificates can either be declared in a crt-store or dynamically loaded
24837+
via the stats socket.
24838+
When a path is given directly, if the corresponding certificate was not
24839+
loaded yet in the internal certificate store, it will be loaded during
24840+
configuration parsing and it thus must already exist otherwise an error
24841+
will be raised.
24842+
24843+
Only certificates that are explicitly defined as usable for JWT validation
24844+
can be used. See &quot;<a href="#jwt">jwt</a>&quot; crt-store option.
2476124845

2476224846
It is possible to update certificates dynamically and add new certificates
2476324847
using the stats socket. See also &quot;set ssl cert&quot; and &quot;new ssl cert&quot; in the
@@ -24780,8 +24864,9 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2478024864
| -2 | &quot;Unmanaged algorithm&quot; |
2478124865
| -3 | &quot;Invalid token&quot; |
2478224866
| -4 | &quot;Out of memory&quot; |
24783-
| -5 | &quot;Unknown certificate&quot; |
24867+
| -5 | &quot;Unknown pubkey/certificate&quot; |
2478424868
| -6 | &quot;Internal error&quot; |
24869+
| -7 | &quot;Unavailable certificate&quot; (see &quot;<a href="#jwt">jwt</a>&quot;) |
2478524870
+----+----------------------------------------------------------------------+
2478624871

2478724872
Please note that this converter is only available when HAProxy has been
@@ -24794,7 +24879,7 @@ <h3 id="chapter-7.3.1" data-target="7.3.1"><small><a class="small" href="#7.3.1"
2479424879
http-request set-var(txn.bearer) http_auth_bearer
2479524880
http-request set-var(txn.jwt_alg) var(txn.bearer),jwt_header_query('$.alg')
2479624881
http-request deny unless { var(txn.jwt_alg) -m str &quot;RS256&quot; }
24797-
http-request deny unless { var(txn.bearer),jwt_verify(txn.jwt_alg,&quot;/path/to/cert.pem&quot;) 1 }
24882+
http-request deny unless { var(txn.bearer),jwt_verify_cert(txn.jwt_alg,&quot;/path/to/cert.pem&quot;) 1 }
2479824883
</code></pre>
2479924884
</div><a class="anchor" name="language"></a><a class="anchor" name="7-language"></a><a class="anchor" name="7.3.1-language"></a><a class="anchor" name="language (Using ACLs and fetching samples)"></a><a class="anchor" name="language (Converters)"></a><div class="keyword"><b><a class="anchor" name="language"></a><a href="#7.3.1-language">language</a></b>(<span style="color: #080">&lt;value&gt;</span><span style="color: #008">[,<span style="color: #080">&lt;default&gt;</span>]</span>)</div><pre class="text">Returns the value with the highest q-factor from a list as extracted from the
2480024885
&quot;accept-language&quot; header using &quot;<a href="#req.fhdr">req.fhdr</a>&quot;. Values with no q-factor have a
@@ -33287,6 +33372,15 @@ <h3 id="chapter-12.7.1" data-target="12.7.1"><small><a class="small" href="#12.7
3328733372
A more precise error message might also be displayed between parenthesis
3328833373
after the &quot;generic&quot; error message. It can happen for &quot;OCSP response check
3328933374
failure&quot; or &quot;Error during insertion&quot; errors.
33375+
</pre><a class="anchor" name="jwt"></a><a class="anchor" name="12-jwt"></a><a class="anchor" name="12.7.1-jwt"></a><a class="anchor" name="jwt (Other sections)"></a><a class="anchor" name="jwt (Load options)"></a><div class="keyword"><b><a class="anchor" name="jwt"></a><a href="#12.7.1-jwt">jwt</a></b> <span style="color: #008">[ off | on ]</span></div><pre class="text">Allow for this certificate to be used for JWT validation via the
33376+
&quot;<a href="#jwt_verify_cert">jwt_verify_cert</a>&quot; converter when set to 'on'. Its value default to 'off'.
33377+
33378+
When set to 'on' for a given certificate, the CLI command &quot;del ssl cert&quot; will
33379+
not work. In order to be deleted, a certificate must not be used, either for
33380+
SSL handshakes or JWT validation.
33381+
33382+
This option can be changed during runtime via the &quot;add ssl jwt&quot; and &quot;del ssl
33383+
jwt&quot; CLI commands. See also &quot;show ssl jwt&quot; CLI command.
3329033384
</pre></div>
3329133385
<a class="anchor" id="12.8" name="12.8"></a>
3329233386
<h2 id="chapter-12.8" data-target="12.8"><small><a class="small" href="#12.8">12.8.</a></small> ACME</h2>
@@ -33397,7 +33491,7 @@ <h2 id="chapter-12.8" data-target="12.8"><small><a class="small" href="#12.8">12
3339733491
<br>
3339833492
<hr>
3339933493
<div class="text-right">
33400-
HAProxy 3.3-dev9-47 &ndash; Configuration Manual<br>
33494+
HAProxy 3.3-dev9-60 &ndash; Configuration Manual<br>
3340133495
<small>, 2025/10/03</small>
3340233496
</div>
3340333497
</div>

0 commit comments

Comments
 (0)