Fix cert expiration warnings
Spotted by @CommanderRoot -- thanks!
This commit is contained in:
parent
e91ce9eb3d
commit
22e63774a1
|
@ -84,12 +84,12 @@ func FetchCurrentDNSCryptCert(proxy *Proxy, serverName *string, proto string, pk
|
||||||
if ttl > 86400*7 {
|
if ttl > 86400*7 {
|
||||||
dlog.Infof("[%v] the key validity period for this server is excessively long (%d days), significantly reducing reliability and forward security.", providerName, ttl/86400)
|
dlog.Infof("[%v] the key validity period for this server is excessively long (%d days), significantly reducing reliability and forward security.", providerName, ttl/86400)
|
||||||
daysLeft := (tsEnd - now) / 86400
|
daysLeft := (tsEnd - now) / 86400
|
||||||
if daysLeft <= 30 {
|
if daysLeft < 1 {
|
||||||
dlog.Infof("[%v] certificate will expire in %d days", providerName, daysLeft)
|
dlog.Criticalf("[%v] certificate will expire today -- Switch to a different resolver as soon as possible", providerName)
|
||||||
} else if daysLeft <= 7 {
|
} else if daysLeft <= 7 {
|
||||||
dlog.Warnf("[%v] certificate is about to expire -- if you don't manage this server, tell the server operator about it", providerName)
|
dlog.Warnf("[%v] certificate is about to expire -- if you don't manage this server, tell the server operator about it", providerName)
|
||||||
} else if daysLeft < 1 {
|
} else if daysLeft <= 30 {
|
||||||
dlog.Criticalf("[%v] certificate will expire today -- Switch to a different resolver as soon as possible", providerName)
|
dlog.Infof("[%v] certificate will expire in %d days", providerName, daysLeft)
|
||||||
}
|
}
|
||||||
certInfo.ForwardSecurity = false
|
certInfo.ForwardSecurity = false
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue