From d5e6b8d016774776d3ca6af72839a9138e2fe996 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 4 Jan 2012 14:56:16 -0500 Subject: [PATCH] crypto/tls: update generate_cert.go for new time package Fixes #2635. R=golang-dev, iant CC=golang-dev https://golang.org/cl/5512043 --- src/pkg/crypto/tls/generate_cert.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pkg/crypto/tls/generate_cert.go b/src/pkg/crypto/tls/generate_cert.go index c4463ff48f8..7c0718b82ab 100644 --- a/src/pkg/crypto/tls/generate_cert.go +++ b/src/pkg/crypto/tls/generate_cert.go @@ -31,7 +31,7 @@ func main() { return } - now := time.Seconds() + now := time.Now() template := x509.Certificate{ SerialNumber: new(big.Int).SetInt64(0), @@ -39,8 +39,8 @@ func main() { CommonName: *hostName, Organization: []string{"Acme Co"}, }, - NotBefore: time.SecondsToUTC(now - 300), - NotAfter: time.SecondsToUTC(now + 60*60*24*365), // valid for 1 year. + NotBefore: now.Add(-5 * time.Minute).UTC(), + NotAfter: now.AddDate(1, 0, 0).UTC(), // valid for 1 year. SubjectKeyId: []byte{1, 2, 3, 4}, KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,