Skip to content

Commit b39bbb6

Browse files
authored
Allow TLSOptions.ServerName use with TLSOptions.SecurityMode (#393)
1 parent 9961e7f commit b39bbb6

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

internal/client/connutils.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,20 +451,19 @@ func (r *configResolver) resolveOptions(
451451
"TLSOptions.SecurityMode option")
452452
}
453453

454+
if len(secSources) > 1 {
455+
return fmt.Errorf(
456+
"mutually exclusive options set in Options: %v",
457+
englishList(secSources, "and"))
458+
}
459+
454460
if opts.TLSOptions.ServerName != "" {
455-
secSources = append(secSources, "TLSOptions.ServerName")
456461
err = r.setTLSServerName(
457462
opts.TLSOptions.ServerName,
458463
"TLSOptions.ServerName options",
459464
)
460465
}
461466

462-
if len(secSources) > 1 {
463-
return fmt.Errorf(
464-
"mutually exclusive options set in Options: %v",
465-
englishList(secSources, "and"))
466-
}
467-
468467
if opts.SecretKey != "" {
469468
err = r.setSecretKey(opts.SecretKey, "SecretKey option")
470469
if err != nil {

shared-client-testcases

0 commit comments

Comments
 (0)