From 9c8b32c2d6a2a2abf3f91617db2cb259feed61b8 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 6 Jul 2011 16:22:21 -0400 Subject: [PATCH] crypto/tls: fix generate_cert.go Fixes #2030. R=golang-dev, gri CC=golang-dev https://golang.org/cl/4635092 --- generate_cert.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generate_cert.go b/generate_cert.go index f461888..41206e2 100644 --- a/generate_cert.go +++ b/generate_cert.go @@ -8,8 +8,10 @@ package main import ( - "crypto/rsa" + "big" + "crypto/x509/pkix" "crypto/rand" + "crypto/rsa" "crypto/x509" "encoding/pem" "flag" @@ -32,8 +34,8 @@ func main() { now := time.Seconds() template := x509.Certificate{ - SerialNumber: []byte{0}, - Subject: x509.Name{ + SerialNumber: new(big.Int).SetInt64(0), + Subject: pkix.Name{ CommonName: *hostName, Organization: []string{"Acme Co"}, },