From 1498b8cecfd1c1c60a842d1563e21d27e4b3b878 Mon Sep 17 00:00:00 2001 From: "Mateusz \"Serafin\" Gajewski" Date: Tue, 26 Nov 2024 15:34:55 +0100 Subject: [PATCH] Fix generating CA cert --- testing/almalinux9-oj17-openldap-base/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testing/almalinux9-oj17-openldap-base/Dockerfile b/testing/almalinux9-oj17-openldap-base/Dockerfile index 6851598e..6062ee10 100644 --- a/testing/almalinux9-oj17-openldap-base/Dockerfile +++ b/testing/almalinux9-oj17-openldap-base/Dockerfile @@ -42,10 +42,11 @@ RUN keytool -export -alias coordinator -storepass testldap -keystore /etc/openld -file /etc/openldap/certs/coordinator.csr # create a test CA and generate caroot.cer( root certificate of the CA ). -RUN openssl req -new -keyout /etc/openldap/certs/cakey.pem -out /etc/openldap/certs/careq.pem -nodes \ - -subj "/C=US/ST=Massachusetts/L=Boston/O=Teradata/OU=Finance/CN=teradata" && \ - openssl x509 -req -in /etc/openldap/certs/careq.pem -out /etc/openldap/certs/caroot.cer -days 100000 \ - -signkey /etc/openldap/certs/cakey.pem +RUN openssl genrsa -out /etc/openldap/certs/cakey.pem 2048 && \ + openssl req -x509 -new -nodes -key /etc/openldap/certs/cakey.pem -sha256 -days 3650 -out /etc/openldap/certs/caroot.cer \ + -subj "/C=US/ST=Massachusetts/L=Boston/O=Teradata/OU=Finance/CN=teradata" \ + -addext "basicConstraints=CA:TRUE" \ + -addext "keyUsage=keyCertSign,cRLSign" # sign the server certificate using the testCA RUN openssl x509 -req -in /etc/openldap/certs/coordinator.csr -out /etc/openldap/certs/TestCA.cer -days 100000 \