4 Commits

Author SHA1 Message Date
William Lallemand
5c9f28641b ADMIN: dump-certs: fix lack of / in -p
Add a trailing / so -p don't fail if it wasn't specified.
2025-09-28 18:21:25 +02:00
William Lallemand
172ac6ad03 ADMIN: dump-certs: create files in a tmpdir
Files dumped from the socket are put in a temporary directory, this
directory is then removed upon exit.

Variable were cleaned to be clearer:
- crt_filename -> prev_crt
- key_filename -> prev_key
- ${crt_filename}.${tmp} -> new_crt
- ${key_filename}.${tmp} -> new_key
2025-09-28 18:21:25 +02:00
William Lallemand
8781c65d8a ADMIN: dump-certs: don't update the file if it's up to date
Compare the fingerprint of the leaf certificate to the previous file to
check if it needs to be updated or not

Also skip the check if no file is on the disk.
2025-09-28 18:21:20 +02:00
William Lallemand
3a6ea8b959 ADMIN: haproxy-dump-certs: implement a certificate dumper
haproxy-dump0-certs is a bash script that connects to your master socket
or your stat socket in order to dump certificates from haproxy memory to
the corresponding files.
2025-09-28 13:38:48 +02:00