Skip to content

Commit

Permalink
Write '*' as 'wildcard' on the filesystem (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbardelmeijer authored and jsha committed Oct 22, 2018
1 parent 4a2c0bd commit 3560439
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ func sign(iss *issuer, domains []string, ipAddresses []string) (*x509.Certificat
} else {
return nil, fmt.Errorf("must specify at least one domain name or IP address")
}
err := os.Mkdir(cn, 0700)
var cnFolder = strings.Replace(cn, "*", "_", -1)
err := os.Mkdir(cnFolder, 0700)
if err != nil && !os.IsExist(err) {
return nil, err
}
key, err := makeKey(fmt.Sprintf("%s/key.pem", cn))
key, err := makeKey(fmt.Sprintf("%s/key.pem", cnFolder))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -230,7 +231,7 @@ func sign(iss *issuer, domains []string, ipAddresses []string) (*x509.Certificat
if err != nil {
return nil, err
}
file, err := os.OpenFile(fmt.Sprintf("%s/cert.pem", cn), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0600)
file, err := os.OpenFile(fmt.Sprintf("%s/cert.pem", cnFolder), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0600)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3560439

Please sign in to comment.