DLS_SSL_CertImportTool.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # *********************************************************************************************************************************
  3. # * Licensed Materials - Property of IBM *
  4. # * IBM Cognos Products: DLS *
  5. # * (C) Copyright IBM Corp. 2005, 2021 *
  6. # * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. *
  7. # *********************************************************************************************************************************
  8. # *************** DLS SSL certificate import tool *********************
  9. # ** This tool is designed to import a SSL certificate in IBM Cognos Java Keystore
  10. # ********************************************************************
  11. # NOTE:
  12. # if successful this message will be shown: Certificate was added to keystore
  13. # if already imported keytool error: java.lang.Exception: Certificate not imported, alias <DLSKeystore> already exists
  14. if [[ -z "$1" ]]; then
  15. echo --------------------------------------------------------------
  16. echo Usage: $0 SSL_Certificate_PATH
  17. echo.
  18. echo e.g.
  19. echo.
  20. echo $0 /mailserver_ssl_keys/certificate.crt
  21. echo --------------------------------------------------------------
  22. exit 1
  23. fi
  24. cd ../ibm-jre/jre/bin
  25. echo importing certificate from $1
  26. keytool -import -alias DLSKeystore -file $1 -keystore ../lib/security/cacerts -storepass changeit -noprompt
  27. cd ../../../bin
  28. echo Done.
  29. exit 1