动态更新OCSP,防止过期

This commit is contained in:
刘祥超
2022-03-18 17:08:51 +08:00
parent 06c9c9403b
commit 3f9c250dff
10 changed files with 195 additions and 78 deletions

View File

@@ -1,5 +1,19 @@
package models
package models_test
import (
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
_ "github.com/go-sql-driver/mysql"
timeutil "github.com/iwind/TeaGo/utils/time"
"testing"
)
func TestSSLCertDAO_ListCertsToUpdateOCSP(t *testing.T) {
var dao = models.NewSSLCertDAO()
certs, err := dao.ListCertsToUpdateOCSP(nil, 3600, 10)
if err != nil {
t.Fatal(err)
}
for _, cert := range certs {
t.Log(cert.Id, cert.Name, "updatedAt:", cert.OcspUpdatedAt, timeutil.FormatTime("Y-m-d H:i:s", int64(cert.OcspUpdatedAt)), cert.OcspIsUpdated)
}
}