]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: ssl: Fix empty line in cli command input
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 7 Feb 2024 15:38:47 +0000 (16:38 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 7 Feb 2024 16:10:49 +0000 (17:10 +0100)
The 'set ssl cert' command was failing because of empty lines in the
contents of the PEM file used to perform the update.
We were also missing the issuer in the newly created ckch_store, which
then raised an error when committing the transaction.

reg-tests/ssl/show_ssl_ocspresponse.vtc

index 186aeccd7d8b03b6fafbf548f5b303fb2d3fbf00..8b1db1692e19a180834612b59be54f0f8af1d77e 100644 (file)
@@ -111,7 +111,8 @@ haproxy h1 -cli {
 
 # Change the server certificate's OCSP response through a transaction
 shell {
-    printf "set ssl cert ${testdir}/show_ocsp_server.pem <<\n$(cat ${testdir}/show_ocsp_server.pem)\n\n" | socat  "${tmpdir}/h1/stats" -
+    printf "set ssl cert ${testdir}/show_ocsp_server.pem <<\n$(cat ${testdir}/show_ocsp_server.pem | sed  '/^$/d')\n\n" | socat  "${tmpdir}/h1/stats" -
+    printf "set ssl cert ${testdir}/show_ocsp_server.pem.issuer <<\n$(cat ${testdir}/show_ocsp_server.pem.issuer | sed  '/^$/d')\n\n" | socat  "${tmpdir}/h1/stats" -
     printf "set ssl cert ${testdir}/show_ocsp_server.pem.ocsp <<\n$(cat ${testdir}/show_ocsp_server.pem.ocsp|openssl base64)\n\n" | socat  "${tmpdir}/h1/stats" -
 }