diff options
author | 2020-02-29 22:17:05 -0500 | |
---|---|---|
committer | 2020-03-03 13:20:06 -0500 | |
commit | 3a27813b663c34df52b2b1b50df7f0754dcfe134 (patch) | |
tree | 1f962778cd649286f70ae7ec8dbc5d868a668a7b /aai-resources/src/main/scripts/updatePem.sh | |
parent | 50315fe106b88e0cd556b8b6fab1dbdd4c9856a4 (diff) |
Update resources to use aai-common changes
Issue-ID: AAI-2750
Change-Id: I33ea2b3d7b4b706edc59c3d45c9957d05effd306
Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-resources/src/main/scripts/updatePem.sh')
-rw-r--r-- | aai-resources/src/main/scripts/updatePem.sh | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/aai-resources/src/main/scripts/updatePem.sh b/aai-resources/src/main/scripts/updatePem.sh index 6e6ac6f..81ba65b 100644 --- a/aai-resources/src/main/scripts/updatePem.sh +++ b/aai-resources/src/main/scripts/updatePem.sh @@ -27,12 +27,24 @@ start_date; check_user; source_profile; -CERTPATH=$PROJECT_HOME/resources/etc/auth/ +prop_file=$PROJECT_HOME/resources/application.properties + +CERTPATH=${PROJECT_HOME}/resources/etc/auth/ KEYNAME=aaiClientPrivateKey.pem CERTNAME=aaiClientPublicCert.pem +CERTIFICATE_FILE=${CERTPATH}aai-client-cert.p12 + +CERTMAN_PATH=`grep ^server.certs.location $prop_file |cut -d'=' -f2 |tr -d "\015"` +if [ -z $CERTMAN_PATH ]; then + echo "Property [server.certs.location] not found in file $prop_file, continuing with default" + pw=$(execute_spring_jar org.onap.aai.util.AAIConfigCommandLinePropGetter "" "aai.keystore.passwd" 2> /dev/null | tail -1) +else + # Assume AAF certificate container use + pw=$(< ${CERTMAN_PATH}/.password) + CERTIFICATE_FILE=${CERTMAN_PATH}/certificate.pkcs12 +fi -pw=$(execute_spring_jar org.onap.aai.util.AAIConfigCommandLinePropGetter "" "aai.keystore.passwd" 2> /dev/null | tail -1) -openssl pkcs12 -in ${CERTPATH}/aai-client-cert.p12 -out $CERTPATH$CERTNAME -clcerts -nokeys -passin pass:$pw -openssl pkcs12 -in ${CERTPATH}/aai-client-cert.p12 -out $CERTPATH$KEYNAME -nocerts -nodes -passin pass:$pw +openssl pkcs12 -in ${CERTIFICATE_FILE} -out $CERTPATH$CERTNAME -nokeys -nodes -passin pass:$pw +openssl pkcs12 -in ${CERTIFICATE_FILE} -nocerts -out $CERTPATH$KEYNAME -nodes -passin pass:$pw end_date; exit 0 |