From 4e07a8fbea93a8b6dba0cf89c756df230a951f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 20 Jul 2026 01:52:54 +0200 Subject: [PATCH] ci: cram: provide TLS certificate to servefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debian 13 ships pyOpenSSL without the deprecated X509Req API used by servefile certificate generation. Generate a short-lived certificate with openssl and pass it to both HTTPS server instances. Assisted-by: codex:gpt-5 Signed-off-by: Petr Štetiar References: PPW-1258 --- .../acceleration-plan-components/130-periodicfileupload.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t b/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t index b190bcb0f6..a937e03583 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/130-periodicfileupload.t @@ -141,7 +141,8 @@ Prepare CABundle for the cram tests: $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.Enable=1"' > /dev/null $ sleep 1 $ kill -9 "$servefile_pid" - $ servefile -u /tmp/130-periodicfileuploads/ -p 8181 --ssl >/dev/null 2>&1 & + $ openssl req -x509 -newkey rsa:2048 -nodes -keyout /tmp/servefile.key -out /tmp/servefile.crt -subj "/CN=$SERVER_IP" -addext "subjectAltName=IP:$SERVER_IP" -days 1 >/dev/null 2>&1 + $ servefile -u /tmp/130-periodicfileuploads/ -p 8181 --ssl --key /tmp/servefile.key --cert /tmp/servefile.crt >/dev/null 2>&1 & $ servefile_pid="$!" $ sleep 4 $ R "openssl s_client -connect \"$SERVER_IP:8181\" -showcerts < /dev/null 2> /dev/null | openssl x509 -outform PEM > /tmp/server-cert.crt" @@ -192,7 +193,7 @@ Check PeriodicFileTransfer error code reporting for various failure scenarios: ] $ kill -9 "$servefile_pid" - $ servefile -u /tmp/130-periodicfileuploads/ -p 8181 --ssl >/dev/null 2>&1 & + $ servefile -u /tmp/130-periodicfileuploads/ -p 8181 --ssl --key /tmp/servefile.key --cert /tmp/servefile.crt >/dev/null 2>&1 & $ servefile_pid="$!" $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.Protocol=HTTPS"' > /dev/null $ R "ba-cli 'Device.PeriodicFileTransfer.Profile.cram-Profile-1.HTTP.URL=\"https://$SERVER_IP:8181\"'" > /dev/null @@ -216,3 +217,4 @@ Cleanup test instances: $ R 'ba-cli "Device.PeriodicFileTransfer.Transfer.cram-Transfer-1.-"' > /dev/null $ R 'ba-cli "Device.PeriodicFileTransfer.Profile.cram-Profile-1.-"' > /dev/null $ kill -9 "$servefile_pid" + $ rm -f /tmp/servefile.key /tmp/servefile.crt