feat: 200 years long media tls cert (#4377)

This commit is contained in:
yqrashawn 2023-12-04 15:54:51 +08:00 committed by GitHub
parent aee111e5ab
commit 82d5e0c849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -13,8 +13,6 @@ import (
"time"
"github.com/ethereum/go-ethereum/log"
"github.com/status-im/status-go/timesource"
)
var globalMediaCertificate *tls.Certificate = nil
@ -82,8 +80,9 @@ func generateMediaTLSCert() error {
return nil
}
notBefore := timesource.GetCurrentTime()
notAfter := notBefore.Add(365 * 24 * time.Hour)
now := time.Now()
notBefore := now.Add(-365 * 24 * time.Hour * 100)
notAfter := now.Add(365 * 24 * time.Hour * 100)
log.Debug("generate media cert", "system time", time.Now().String(), "cert notBefore", notBefore.String(), "cert notAfter", notAfter.String())
finalCert, certPem, err := GenerateTLSCert(notBefore, notAfter, []net.IP{}, []string{Localhost})
if err != nil {