Skip to content

Commit

Permalink
Issue certificates with NotBefore set 1 day prior to avoid drift/time…
Browse files Browse the repository at this point in the history
…zone issues in VM
  • Loading branch information
ivan-section-io authored and dlorenc committed May 23, 2018
1 parent 902e496 commit 4bdba1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func GenerateCACert(certPath, keyPath string, name string) error {
Subject: pkix.Name{
CommonName: name,
},
NotBefore: time.Now(),
NotBefore: time.Now().Add(time.Hour * -24),
NotAfter: time.Now().Add(time.Hour * 24 * 365 * 10),

KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
Expand Down Expand Up @@ -92,7 +92,7 @@ func GenerateSignedCert(certPath, keyPath, cn string, ips []net.IP, alternateDNS
CommonName: cn,
Organization: []string{"system:masters"},
},
NotBefore: time.Now(),
NotBefore: time.Now().Add(time.Hour * -24),
NotAfter: time.Now().Add(time.Hour * 24 * 365),

KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
Expand Down

0 comments on commit 4bdba1f

Please sign in to comment.