public static String hideOpenSslPassword(String command) {
    int start;
    if (command.contains(PASS_TOKEN)) {
      start = command.indexOf(PASS_TOKEN) + PASS_TOKEN.length();
    } else if (command.contains(KEY_TOKEN)) {
      start = command.indexOf(KEY_TOKEN) + KEY_TOKEN.length();
    } else {
      return command;
    }
    CharSequence cs = command.subSequence(start, command.indexOf(" ", start));
    return command.replace(cs, "****");
  }
Logs OpenSsl command exit code with description
ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java