Skip to content

Commit 828fe05

Browse files
committed
Oops, had the Lifetime math wrong
1 parent e94db39 commit 828fe05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

certificates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func (cert Certificate) Lifetime() time.Duration {
193193
if cert.Leaf == nil || cert.Leaf.NotAfter.IsZero() {
194194
return 0
195195
}
196-
return cert.Leaf.NotAfter.Sub(expiresAt(cert.Leaf))
196+
return expiresAt(cert.Leaf).Sub(cert.Leaf.NotBefore)
197197
}
198198

199199
// currentlyInRenewalWindow returns true if the current time is within

0 commit comments

Comments
 (0)