Fix unconvert checks in server

This commit is contained in:
Waldemar Quevedo
2017-03-23 20:41:38 -07:00
parent 80490020b2
commit 8926fa0ff1
2 changed files with 3 additions and 3 deletions

View File

@@ -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")
}

View File

@@ -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