Repository: go
Issue: encoding/asn1: valid GeneralizedTime with UTC offset of +0000 not parsed
Labels: NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.12.7 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?
Yes.


### What operating system and processor architecture are you using (`go env`)?
macOS 10.14.5

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/[user]/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/[user]/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.7/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.7/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/84/_6l41bt970l9fmsrwc_p1gv00000gn/T/go-build217266963=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?
Attempted to upgrade to TLS on a server I don't control.

It appears that the time format is valid, according to the documentation I've found ([here](https://www.obj-sys.com/asn1tutorial/node14.html), among other places).

Public cert from that server included in [this failing test](https://play.golang.org/p/L1jCqoW6J4K):

```golang
func TestUTCOffset(t *testing.T) {
	certPEM := []byte(`-----BEGIN CERTIFICATE-----
MIIDNzCCAqCgAwIBAgIJAOG5Q5oZboH9MA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNV
BAYTAmNhMREwDwYDVQQHEwhJbm5pc2ZpbDENMAsGA1U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ate(certDERBlock.Bytes)
	if err != nil {
		t.Fatal(err)
	}
}
```

### What did you expect to see?
The certificate would get parsed.

### What did you see instead?
`asn1: time did not serialize back to the original value and may be invalid: given "360329021729+0000", but serialized as "360329021729Z"`

The problem looks like it may be in the same area as #15842.