mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-01 03:15:01 +08:00 
			
		
		
		
	caddypki: Remove lifetime check at Caddyfile parse (fix #6878)
The same check is done at provision time of the ACME server, and that is the correct place to do it.
This commit is contained in:
		| @ -15,8 +15,6 @@ | ||||
| package acmeserver | ||||
|  | ||||
| import ( | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/caddyserver/caddy/v2" | ||||
| 	"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile" | ||||
| 	"github.com/caddyserver/caddy/v2/modules/caddypki" | ||||
| @ -74,14 +72,10 @@ func parseACMEServer(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error | ||||
| 			if !h.NextArg() { | ||||
| 				return nil, h.ArgErr() | ||||
| 			} | ||||
|  | ||||
| 			dur, err := caddy.ParseDuration(h.Val()) | ||||
| 			if err != nil { | ||||
| 				return nil, err | ||||
| 			} | ||||
| 			if d := time.Duration(ca.IntermediateLifetime); d > 0 && dur > d { | ||||
| 				return nil, h.Errf("certificate lifetime (%s) exceeds intermediate certificate lifetime (%s)", dur, d) | ||||
| 			} | ||||
| 			acmeServer.Lifetime = caddy.Duration(dur) | ||||
| 		case "resolvers": | ||||
| 			acmeServer.Resolvers = h.RemainingArgs() | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Matthew Holt
					Matthew Holt