Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed May 23, 2024
1 parent c0c6a81 commit 452059f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/pkg/transport/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ func (info TLSInfo) baseConfig() (*tls.Config, error) {
// or a more general check of the CN and SANs.
var verifyCertificate func(*x509.Certificate) bool
if len(info.AllowedCNs) > 0 {
info.Logger.Warn("TLS: using CN verification", zap.Strings("allowed-cn", info.AllowedCNs))
if len(info.AllowedHostnames) > 0 {
return nil, fmt.Errorf("AllowedCNs and AllowedHostnames are mutually exclusive (cn=%q, hostname=%q)", info.AllowedCNs, info.AllowedHostnames)
}
Expand All @@ -425,6 +426,7 @@ func (info TLSInfo) baseConfig() (*tls.Config, error) {
}
}
if len(info.AllowedHostnames) > 0 {
info.Logger.Warn("TLS: using hostname verification", zap.Strings("allowed-hostnames", info.AllowedHostnames))
verifyCertificate = func(cert *x509.Certificate) bool {
for _, allowedHostname := range info.AllowedHostnames {
if cert.VerifyHostname(allowedHostname) == nil {
Expand Down

0 comments on commit 452059f

Please sign in to comment.