caddytls: Context to DecisionFunc (#5923)

See https://github.com/caddyserver/certmagic/pull/255
This commit is contained in:
Andreas Kohn
2023-12-07 18:40:13 +01:00
committed by Matthew Holt
parent 908e956927
commit df5edf6bdb
3 changed files with 5 additions and 2 deletions

View File

@@ -15,6 +15,7 @@
package caddytls
import (
"context"
"encoding/json"
"errors"
"fmt"
@@ -251,7 +252,7 @@ func (ap *AutomationPolicy) Provision(tlsApp *TLS) error {
return fmt.Errorf("on-demand TLS cannot be enabled without an 'ask' endpoint to prevent abuse; please refer to documentation for details")
}
ond = &certmagic.OnDemandConfig{
DecisionFunc: func(name string) error {
DecisionFunc: func(ctx context.Context, name string) error {
if tlsApp.Automation == nil || tlsApp.Automation.OnDemand == nil {
return nil
}