mirror of
https://github.com/makew0rld/amfora.git
synced 2024-09-27 23:05:55 -04: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
|
### Added
|
||||||
- Link and heading lines are wrapped just like regular text lines
|
- Link and heading lines are wrapped just like regular text lines
|
||||||
- Wrapped list items are indented to stay behind the bullet (#35)
|
- Wrapped list items are indented to stay behind the bullet (#35)
|
||||||
|
- Certificate expiry date is stored when the cert IDs match (#39)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Pages are rewrapped dynamically, whenever the terminal size changes (#33)
|
- 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)
|
saveTofuEntry(domain, port, cert)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if time.Now().After(expiry) {
|
|
||||||
// Old cert expired, so anything is valid
|
|
||||||
saveTofuEntry(domain, port, cert)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if certID(cert) == id {
|
if certID(cert) == id {
|
||||||
// Same cert as the one stored
|
// 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
|
return true
|
||||||
}
|
}
|
||||||
if origCertID(cert) == id {
|
if origCertID(cert) == id {
|
||||||
@ -99,6 +99,11 @@ func handleTofu(domain, port string, cert *x509.Certificate) bool {
|
|||||||
saveTofuEntry(domain, port, cert)
|
saveTofuEntry(domain, port, cert)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if time.Now().After(expiry) {
|
||||||
|
// Old cert expired, so anything is valid
|
||||||
|
saveTofuEntry(domain, port, cert)
|
||||||
|
return true
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user