Skip to content

Commit

Permalink
bugfix first eku not parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
nothinux committed Apr 16, 2022
1 parent 2b12022 commit e7cee02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/certify/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ func parseCN(cn string) string {
func parseEKU(ekus string) []x509.ExtKeyUsage {
var ExtKeyUsage []x509.ExtKeyUsage

for _, eku := range strings.Split(ekus, ",") {
parsedEku := strings.Split(strings.TrimLeft(ekus, "eku:"), ",")

for _, eku := range parsedEku {
e := strings.ToLower(eku)
if e == "serverauth" {
ExtKeyUsage = append(ExtKeyUsage, x509.ExtKeyUsageServerAuth)
Expand Down

0 comments on commit e7cee02

Please sign in to comment.