MEDIUM: ssl/cli: 'add ssl crt-list' command
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 25 Mar 2020 13:42:37 +0000 (14:42 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 31 Mar 2020 10:32:18 +0000 (12:32 +0200)
commite67c80be7f19c2d4417843064d2ca6f502da0c87
treea20aced11bf619711d1e2ea1742f58a21687cc52
parent90afe90681badedadb8ec486b371a2870e6eb448
MEDIUM: ssl/cli: 'add ssl crt-list' command

The new 'add ssl crt-list' command allows to add a new crt-list entry in
a crt-list (or a directory since they are handled the same way).

The principle is basicaly the same as the "commit ssl cert" command with
the exception that it iterates on every bind_conf that uses the crt-list
and generates a ckch instance (ckch_inst) for each of them.

The IO handler yield every 10 bind_confs so HAProxy does not get stuck in
a too much time consuming generation if it needs to generate too much
SSL_CTX'.

This command does not handle the SNI filters and the SSL configuration
yet.

Example:

  $ echo "new ssl cert foo.net.pem" | socat /tmp/sock1 -
  New empty certificate store 'foo.net.pem'!

  $ echo -e -n "set ssl cert foo.net.pem <<\n$(cat foo.net.pem)\n\n" | socat /tmp/sock1 -
  Transaction created for certificate foo.net.pem!

  $ echo "commit ssl cert foo.net.pem" | socat /tmp/sock1 -
  Committing foo.net.pem
  Success!

  $ echo "add ssl crt-list one.crt-list foo.net.pem" | socat /tmp/sock1 -
  Inserting certificate 'foo.net.pem' in crt-list 'one.crt-list'......
  Success!

  $ echo "show ssl crt-list one.crt-list" | socat /tmp/sock1 -
  # one.crt-list
  0x55d17d7be360 kikyo.pem.rsa [ssl-min-ver TLSv1.0 ssl-max-ver TLSv1.3]
  0x55d17d82cb10 foo.net.pem
src/ssl_sock.c