X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=install%2Fhelm%2Fran%2Fcerts%2Fgen-certs.sh;h=705b1f37d4b120f11456c6f443e91f7fe0926ad7;hb=HEAD;hp=ec58eee214a05de7537cec1861619f863589bbe9;hpb=d806dbef4f43bb9c631c818e96c1a39e440c5e6c;p=nonrtric%2Fplt%2Franpm.git diff --git a/install/helm/ran/certs/gen-certs.sh b/install/helm/ran/certs/gen-certs.sh index ec58eee..705b1f3 100755 --- a/install/helm/ran/certs/gen-certs.sh +++ b/install/helm/ran/certs/gen-certs.sh @@ -49,15 +49,8 @@ openssl genrsa 2048 > ca.key 2> /dev/null check_error $? echo " Generating ca cert" -cat <<__EOF__ | openssl req -new -x509 -nodes -days 365000 -key ca.key -out httpsca.crt 2> /dev/null -SE -. -. -EST -EST -$SRV -. -__EOF__ +openssl req -new -x509 -nodes -days 365000 -key ca.key -subj "/C=SE/ST=./L=./O=EST/OU=EST/CN=$SRV/emailAddress=a@example.com" -out httpsca.crt 2> /dev/null + check_error $? @@ -65,16 +58,8 @@ for (( i=0; i<${1}; i++ )); do SRV="pm-https-server-$i.pm-https-server.ran" echo " Generating cert and key for server $SRV" -cat <<__EOF__ | openssl req -newkey rsa:2048 -nodes -days 365000 -keyout https-$i.key -out https-req$i.crt 2> /dev/null -SE -. -. -ERIC -ERIC -$SRV -. - -__EOF__ + openssl req -newkey rsa:2048 -nodes -days 365000 -subj "/C=SE/ST=./L=./O=ERIC/OU=ERIC/CN=$SRV/emailAddress=a@example.com" -keyout https-$i.key -out https-req$i.crt 2> /dev/null + check_error $? openssl x509 -req -days 365000 -set_serial 01 -in https-req$i.crt -out https-$i.crt -CA httpsca.crt -CAkey ca.key @@ -86,4 +71,5 @@ __EOF__ done echo "DONE" -exit 0 \ No newline at end of file +exit 0 +