🐛 修复SSL证书变动状态更新

This commit is contained in:
naiba
2021-06-13 01:44:08 +08:00
parent 2057922783
commit c4f36d17d5
3 changed files with 3 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ import (
pb "github.com/naiba/nezha/proto"
)
var Version = "v0.7.3" // !!记得修改 README 中的 badge 版本!!
var Version = "v0.7.4" // !!记得修改 README 中的 badge 版本!!
const (
SnapshotDelay = 3

View File

@@ -318,6 +318,7 @@ func (ss *ServiceSentinel) worker() {
expiresOld, _ = time.Parse("2006-01-02 15:04:05 -0700 MST", oldCert[1])
}
if oldCert[0] != newCert[0] && !expiresNew.Equal(expiresOld) {
ss.sslCertCache[mh.MonitorID] = mh.Data
errMsg = fmt.Sprintf(
"SSL证书变更%s, %s 过期;新:%s, %s 过期。",
oldCert[0], expiresOld.Format("2006-01-02 15:04:05"), newCert[0], expiresNew.Format("2006-01-02 15:04:05"))