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:
parent
58100320b7
commit
7c55a837cd
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue