diff --git a/nomad/rpc.go b/nomad/rpc.go index a39f3cce550b..96db49b641bd 100644 --- a/nomad/rpc.go +++ b/nomad/rpc.go @@ -128,7 +128,8 @@ func (ctx *RPCContext) ValidateCertificateForName(name string) error { return errors.New("missing certificate information") } - validNames := append(cert.DNSNames, cert.Subject.CommonName) + validNames := []string{cert.Subject.CommonName} + validNames = append(validNames, cert.DNSNames...) for _, valid := range validNames { if name == valid { return nil