caddytls: Fix broken refactor

Not sure how that happened...
This commit is contained in:
Matthew Holt 2025-03-06 08:54:40 -07:00
parent a807fe0659
commit bc3d497739
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
3 changed files with 3 additions and 3 deletions

View File

@ -585,7 +585,7 @@ func parseOptECH(d *caddyfile.Dispenser, _ any) (any, error) {
publicNames := d.RemainingArgs() publicNames := d.RemainingArgs()
for _, publicName := range publicNames { for _, publicName := range publicNames {
ech.Configs = append(ech.Configs, caddytls.ECHConfiguration{ ech.Configs = append(ech.Configs, caddytls.ECHConfiguration{
OuterSNI: publicName, PublicName: publicName,
}) })
} }
if len(ech.Configs) == 0 { if len(ech.Configs) == 0 {

View File

@ -375,7 +375,7 @@ func (st ServerType) buildTLSApp(
return nil, warnings, err return nil, warnings, err
} }
for _, cfg := range ech.Configs { for _, cfg := range ech.Configs {
ap.SubjectsRaw = append(ap.SubjectsRaw, cfg.OuterSNI) ap.SubjectsRaw = append(ap.SubjectsRaw, cfg.PublicName)
} }
if tlsApp.Automation == nil { if tlsApp.Automation == nil {
tlsApp.Automation = new(caddytls.AutomationConfig) tlsApp.Automation = new(caddytls.AutomationConfig)

View File

@ -136,7 +136,7 @@ func (ech *ECH) Provision(ctx caddy.Context) ([]string, error) {
// current/active, so they can be used for ECH retries // current/active, so they can be used for ECH retries
for _, cfg := range ech.Configs { for _, cfg := range ech.Configs {
publicName := strings.ToLower(strings.TrimSpace(cfg.OuterSNI)) publicName := strings.ToLower(strings.TrimSpace(cfg.PublicName))
if list, ok := ech.configs[publicName]; ok && len(list) > 0 { if list, ok := ech.configs[publicName]; ok && len(list) > 0 {
// at least one config with this public name was loaded, so find the // at least one config with this public name was loaded, so find the