Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/x509: cert from google fails to parse #8387

gopherbot opened this issue Jul 17, 2014 · 2 comments

crypto/x509: cert from google fails to parse #8387

gopherbot opened this issue Jul 17, 2014 · 2 comments


Copy link

@gopherbot gopherbot commented Jul 17, 2014


Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:

> go version
go version go1.3 darwin/amd64

What steps reproduce the problem?
If possible, include a link to a program on

2. See error "asn1: structure error: tags don't match (16 vs {class:0 tag:13
length:45 isCompound:true}) {optional:false explicit:false application:false
defaultValue:<nil> tag:<nil> stringType:0 set:false omitEmpty:false}
certificate @2"

What happened?

Go fails to parse the google cert (it is in pem format)

What should have happened instead?

It should have parsed the cert.

Please provide any additional information below.

Note that this exact same cert works properly with the google provided Ruby Gem :


  1. x509_test.go (1201 bytes)
Copy link

@ianlancetaylor ianlancetaylor commented Jul 17, 2014

Comment 1:

Labels changed: added repo-main, release-go1.4.

Copy link

@agl agl commented Jul 17, 2014

Comment 2:

You need to use encoding/pem to unwrap the base64 encoding first.

Status changed to Invalid.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.