feat: 200 years long media tls cert (#4377)
This commit is contained in:
parent
aee111e5ab
commit
82d5e0c849
|
@ -13,8 +13,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
|
|
||||||
"github.com/status-im/status-go/timesource"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var globalMediaCertificate *tls.Certificate = nil
|
var globalMediaCertificate *tls.Certificate = nil
|
||||||
|
@ -82,8 +80,9 @@ func generateMediaTLSCert() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
notBefore := timesource.GetCurrentTime()
|
now := time.Now()
|
||||||
notAfter := notBefore.Add(365 * 24 * time.Hour)
|
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())
|
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})
|
finalCert, certPem, err := GenerateTLSCert(notBefore, notAfter, []net.IP{}, []string{Localhost})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue