Skip to content

Commit 5af3b4a

Browse files
committed
Fix tls auth type validation
Signed-off-by: pincher95 <[email protected]>
1 parent a5a35b2 commit 5af3b4a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

config/config.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ func (c *Config) validate() error {
9797
if am.TLS != nil {
9898
// For cert-based auth (type: tls), cert and key are required
9999
// For other auth types, TLS config is optional and used for transport security
100-
if strings.ToLower(am.Type) == "tls" {
101-
// Already validated above that cert and key are present
102-
} else {
100+
if strings.ToLower(am.Type) != "tls" {
103101
// For non-TLS auth types, if cert/key are provided, both must be present
104102
if (am.TLS.CertFile != "") != (am.TLS.KeyFile != "") {
105103
return fmt.Errorf("auth_module %s: if providing client certificate, both cert_file and key_file must be specified", name)

0 commit comments

Comments
 (0)