MINOR: ssl: move certificate selection in a dedicate function
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 23 Nov 2023 15:35:52 +0000 (16:35 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 24 Nov 2023 19:07:27 +0000 (20:07 +0100)
commit9f2e07bf7b01dd32dcbc55d1452b7d50ac2c911d
tree1011fe03c7a6441aaa9709e321086e427c33f189
parentb900a3533cd604b76bbaad9701c9e85f06991638
MINOR: ssl: move certificate selection in a dedicate function

The certificate selection used in the WolfSSL cert_cb and in the OpenSSL
clienthello callback is the same, the function was duplicate to achieve
the same.

This patch move the selection code to a common function called
ssl_sock_chose_sni_ctx().

The servername string is still lowered in the callback, however the
search for the first dot in the string (wildp) is done in
ssl_sock_chose_sni_ctx()

The function uses the same certificate selection algorithm as before, it
needs to know if you need rsa or ecdsa, the bind_conf to achieve the
lookup, and the servername string.

This patch moves the code for WolSSL only.
src/ssl_sock.c