net/haproxy: add support for req.ssl_hello_type, closes #2311

This commit is contained in:
Frank Wall
2022-10-21 15:43:45 +02:00
parent 8300f1920b
commit 32e6a1d618
4 changed files with 28 additions and 0 deletions
+5
View File
@@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing.
Plugin Changelog
================
3.12
Added:
* add support for req.ssl_hello_type (#2311)
3.11
Added:
@@ -278,6 +278,17 @@
<type>text</type>
<help><![CDATA[Verify the CA Common-Name of the certificate presented by the client against the specified string.]]></help>
</field>
<field>
<label>Parameters</label>
<type>header</type>
<style>expression_table table_ssl_hello_type</style>
</field>
<field>
<id>acl.ssl_hello_type</id>
<label>SSL Hello Type</label>
<type>dropdown</type>
<help><![CDATA[An integer value containing the type of the SSL hello message found in the request buffer if the buffer contains data that parse as a complete SSL (v3 or superior) client hello message.]]></help>
</field>
<field>
<label>Parameters</label>
<type>header</type>
@@ -1599,6 +1599,7 @@
<ssl_c_verify>SSL Client certificate is valid</ssl_c_verify>
<ssl_c_verify_code>SSL Client certificate verify error result</ssl_c_verify_code>
<ssl_c_ca_commonname>SSL Client certificate issued by CA common-name</ssl_c_ca_commonname>
<ssl_hello_type>SSL Hello Type</ssl_hello_type>
<src>Source IP matches specified IP</src>
<src_is_local>Source IP is local</src_is_local>
<src_port>Source IP: TCP source port</src_port>
@@ -1764,6 +1765,15 @@
<mask>/^.{1,4096}$/u</mask>
<Required>N</Required>
</ssl_c_ca_commonname>
<ssl_hello_type type="OptionField">
<Required>N</Required>
<default>x1</default>
<OptionValues>
<x0>0 - no client hello</x0>
<x1>1 - client hello</x1>
<x2>2 - server hello</x2>
</OptionValues>
</ssl_hello_type>
<src type="TextField">
<mask>/^.{1,4096}$/u</mask>
<Required>N</Required>
@@ -284,6 +284,8 @@
{% set acl_enabled = '0' %}
# ERROR: missing parameters
{% endif %}
{% elif acl_data.expression == 'ssl_hello_type' %}
{% do acl_options.append('req.ssl_hello_type ' ~ acl_data.ssl_hello_type|replace('x', '')) %}
{% elif acl_data.expression == 'src' %}
{% if acl_data.src|default("") != "" %}
{% do acl_options.append('src ' ~ acl_data.src) %}