0
0
Fork 0

only add ips and names when they are set

If these options are not set, they would produce invalid values in the
resulting csr.
This commit is contained in:
Gibheer 2015-02-04 21:55:00 +01:00
parent 58100320b7
commit 7c55a837cd
1 changed files with 8 additions and 4 deletions

View File

@ -79,10 +79,14 @@ func parse_sign_flags() SignFlags {
fs.Parse(os.Args[2:])
// convert array flags to config structs
flags.DNSNames = COMMA_SPLIT.Split(dns_names, -1)
tmp_ips := COMMA_SPLIT.Split(ips, -1)
for _, sip := range tmp_ips {
flags.IPAddresses = append(flags.IPAddresses, net.ParseIP(sip))
if dns_names != "" {
flags.DNSNames = COMMA_SPLIT.Split(dns_names, -1)
}
if ips != "" {
tmp_ips := COMMA_SPLIT.Split(ips, -1)
for _, sip := range tmp_ips {
flags.IPAddresses = append(flags.IPAddresses, net.ParseIP(sip))
}
}
container_type := reflect.ValueOf(container)