Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
encoding/asn1: dates past 2049 are not properly marshalled #6976
What steps will reproduce the problem? Create two certificates with different validity dates: http://play.golang.org/p/YAK0tEvGv9 What is the expected output? generating key pair... generating certificate... generating key pair... generating certificate... What do you see instead? generating key pair... generating certificate... generating key pair... generating certificate... long time: asn1: structure error: cannot represent time as UTCTime Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? OSX 10.6 Which version are you using? (run 'go version') go version go1.2 darwin/amd64 Please provide any additional information below. the problem lies in encoding/asn1/marshal.go - marshalBody() line 381 assumes that any timeType should be marshalled as UTC where the RFC states quite clearly any date beyond 2049 must be encoded as GeneralizedTime (http://tools.ietf.org/html/rfc5280#page-22) which is a standard asn.1 type.