diff --git a/server/opts.go b/server/opts.go index 8b97fa45..ede0a134 100644 --- a/server/opts.go +++ b/server/opts.go @@ -625,7 +625,7 @@ func GenTLSConfig(tc *TLSConfigOpts) (*tls.Config, error) { return nil, err } pool := x509.NewCertPool() - ok := pool.AppendCertsFromPEM([]byte(rootPEM)) + ok := pool.AppendCertsFromPEM(rootPEM) if !ok { return nil, fmt.Errorf("failed to parse root ca certificate") } diff --git a/server/sublist.go b/server/sublist.go index 6dae92ca..b8e671b5 100644 --- a/server/sublist.go +++ b/server/sublist.go @@ -571,7 +571,7 @@ func IsValidSubject(subject string) bool { return false } sfwc := false - tokens := strings.Split(string(subject), tsep) + tokens := strings.Split(subject, tsep) for _, t := range tokens { if len(t) == 0 || sfwc { return false @@ -589,7 +589,7 @@ func IsValidSubject(subject string) bool { // IsValidLiteralSubject returns true if a subject is valid and literal (no wildcards), false otherwise func IsValidLiteralSubject(subject string) bool { - tokens := strings.Split(string(subject), tsep) + tokens := strings.Split(subject, tsep) for _, t := range tokens { if len(t) == 0 { return false