mirror of
https://github.com/makew0rld/amfora.git
synced 2024-11-28 02:02:34 +03:00
🐛 Expiry date is stored when cert IDs match - fixes #39
This commit is contained in:
parent
92eb544b0a
commit
4382eaf421
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
- Link and heading lines are wrapped just like regular text lines
|
||||
- Wrapped list items are indented to stay behind the bullet (#35)
|
||||
- Certificate expiry date is stored when the cert IDs match (#39)
|
||||
|
||||
### Changed
|
||||
- Pages are rewrapped dynamically, whenever the terminal size changes (#33)
|
||||
|
@ -85,13 +85,13 @@ func handleTofu(domain, port string, cert *x509.Certificate) bool {
|
||||
saveTofuEntry(domain, port, cert)
|
||||
return true
|
||||
}
|
||||
if time.Now().After(expiry) {
|
||||
// Old cert expired, so anything is valid
|
||||
saveTofuEntry(domain, port, cert)
|
||||
return true
|
||||
}
|
||||
if certID(cert) == id {
|
||||
// Same cert as the one stored
|
||||
|
||||
// Store expiry again in case it changed
|
||||
tofuStore.Set(expiryKey(domain, port), cert.NotAfter.UTC())
|
||||
tofuStore.WriteConfig()
|
||||
|
||||
return true
|
||||
}
|
||||
if origCertID(cert) == id {
|
||||
@ -99,6 +99,11 @@ func handleTofu(domain, port string, cert *x509.Certificate) bool {
|
||||
saveTofuEntry(domain, port, cert)
|
||||
return true
|
||||
}
|
||||
if time.Now().After(expiry) {
|
||||
// Old cert expired, so anything is valid
|
||||
saveTofuEntry(domain, port, cert)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user