Github user alopresto commented on a diff in the pull request:
https://github.com/apache/nifi/pull/695#discussion_r73253303
--- Diff:
nifi-toolkit/nifi-toolkit-tls/src/main/java/org/apache/nifi/toolkit/tls/standalone/TlsToolkitStandaloneCommandLine.java
---
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nifi.toolkit.tls.standalone;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.nifi.toolkit.tls.commandLine.BaseCommandLine;
+import org.apache.nifi.toolkit.tls.commandLine.CommandLineParseException;
+import org.apache.nifi.toolkit.tls.commandLine.ExitCode;
+import org.apache.nifi.toolkit.tls.configuration.TlsConfig;
+import org.apache.nifi.toolkit.tls.properties.NiFiPropertiesWriterFactory;
+import org.apache.nifi.toolkit.tls.util.PasswordUtil;
+import org.apache.nifi.toolkit.tls.util.TlsHelper;
+import org.apache.nifi.util.StringUtils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class TlsToolkitStandaloneCommandLine extends BaseCommandLine {
+ public static final String OUTPUT_DIRECTORY_ARG = "outputDirectory";
+ public static final String NIFI_PROPERTIES_FILE_ARG =
"nifiPropertiesFile";
+ public static final String KEY_STORE_PASSWORD_ARG = "keyStorePassword";
+ public static final String TRUST_STORE_PASSWORD_ARG =
"trustStorePassword";
+ public static final String KEY_PASSWORD_ARG = "keyPassword";
+ public static final String SAME_KEY_AND_KEY_STORE_PASSWORD_ARG =
"sameKeyAndKeyStorePassword";
+ public static final String HOSTNAMES_ARG = "hostnames";
+ public static final String HTTPS_PORT_ARG = "httpsPort";
+
+ public static final String DEFAULT_OUTPUT_DIRECTORY = new
File(".").getAbsolutePath();
+
+ public static final String DESCRIPTION = "Creates certificates and
config files for nifi cluster.";
+
+ private final PasswordUtil passwordUtil;
+ private File baseDir;
+ private List<String> hostnames;
+ private String httpsPort;
+ private NiFiPropertiesWriterFactory niFiPropertiesWriterFactory;
+ private List<String> keyStorePasswords;
+ private List<String> keyPasswords;
+ private List<String> trustStorePasswords;
+
+ public TlsToolkitStandaloneCommandLine() {
+ this(new PasswordUtil());
+ }
+
+ protected TlsToolkitStandaloneCommandLine(PasswordUtil passwordUtil) {
+ super(DESCRIPTION);
+ this.passwordUtil = passwordUtil;
+ addOptionWithArg("o", OUTPUT_DIRECTORY_ARG, "The directory to
output keystores, truststore, config files.", DEFAULT_OUTPUT_DIRECTORY);
+ addOptionWithArg("n", HOSTNAMES_ARG, "Comma separated list of
hostnames.", TlsConfig.DEFAULT_HOSTNAME);
--- End diff --
If `-p` is set, the HTTPS port will be set, but the HTTPS hostname is not.
It should be available from this list, so it should be populated.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---