]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: cli/ssl: configure ssl on server at runtime
authorWilliam Dauchy <wdauchy@gmail.com>
Sat, 14 Nov 2020 18:25:33 +0000 (19:25 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 18 Nov 2020 16:22:28 +0000 (17:22 +0100)
commitf63704488ea123f6235c5b90d16209dae7de165e
tree956de6858d2ea2d65cc88a75bff02b4949f51145
parentfc52f524b085bb53885200e6817d8a37e4710531
MEDIUM: cli/ssl: configure ssl on server at runtime

in the context of a progressive backend migration, we want to be able to
activate SSL on outgoing connections to the server at runtime without
reloading.
This patch adds a `set server ssl` command; in order to allow that:

- add `srv_use_ssl` to `show servers state` command for compatibility,
  also update associated parsing
- when using default-server ssl setting, and `no-ssl` on server line,
  init SSL ctx without activating it
- when triggering ssl API, de/activate SSL connections as requested
- clean ongoing connections as it is done for addr/port changes, without
  checking prior server state

example config:

backend be_foo
  default-server ssl
  server srv0 127.0.0.1:6011 weight 1 no-ssl

show servers state:

  5 be_foo 1 srv0 127.0.0.1 2 0 1 1 15 1 0 4 0 0 0 0 - 6011 - -1

where srv0 can switch to ssl later during the runtime:

  set server be_foo/srv0 ssl on

  5 be_foo 1 srv0 127.0.0.1 2 0 1 1 15 1 0 4 0 0 0 0 - 6011 - 1

Also update existing tests and create a new one.

Signed-off-by: William Dauchy <wdauchy@gmail.com>
13 files changed:
doc/configuration.txt
doc/management.txt
include/haproxy/server-t.h
include/haproxy/ssl_sock.h
reg-tests/checks/1be_40srv_odd_health_checks.vtc
reg-tests/checks/40be_2srv_odd_health_checks.vtc
reg-tests/checks/4be_1srv_health_checks.vtc
reg-tests/server/cli_set_ssl.vtc [new file with mode: 0644]
src/cfgparse-ssl.c
src/cfgparse.c
src/proxy.c
src/server.c
src/ssl_sock.c