Skip to content

Commit

Permalink
Oops, had the Lifetime math wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Nov 8, 2024
1 parent e94db39 commit 828fe05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (cert Certificate) Lifetime() time.Duration {
if cert.Leaf == nil || cert.Leaf.NotAfter.IsZero() {
return 0
}
return cert.Leaf.NotAfter.Sub(expiresAt(cert.Leaf))
return expiresAt(cert.Leaf).Sub(cert.Leaf.NotBefore)
}

// currentlyInRenewalWindow returns true if the current time is within
Expand Down

0 comments on commit 828fe05

Please sign in to comment.