cloud_discovery: rtrim() the extracted subject

this removes trailing \n\n characters

Fixes: WIFI-14694
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2025-06-13 08:45:55 +02:00
parent 470703a490
commit 2798088cec

View File

@@ -159,6 +159,7 @@ function generate_csr() {
let pipe = fs.popen('openssl x509 -in /etc/ucentral/cert.pem -noout -subject'); let pipe = fs.popen('openssl x509 -in /etc/ucentral/cert.pem -noout -subject');
let subject = pipe.read("all"); let subject = pipe.read("all");
pipe.close(); pipe.close();
subject = rtrim(subject);
subject = replace(subject, 'subject=', '/'); subject = replace(subject, 'subject=', '/');
subject = replace(subject, ' = ', '='); subject = replace(subject, ' = ', '=');
subject = replace(subject, ', ', '/'); subject = replace(subject, ', ', '/');