FAQ
The error you are getting is "crypto/tls: failed to parse certificate PEM
data". It comes from here:

func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (cert Certificate, err
error) {
var certDERBlock *pem.Block
for {
certDERBlock, certPEMBlock = pem.Decode(certPEMBlock)
if certDERBlock == nil {
break
}
if certDERBlock.Type == "CERTIFICATE" {
cert.Certificate = append(cert.Certificate,
certDERBlock.Bytes)
}
}

if len(cert.Certificate) == 0 {
err = errors.New("crypto/tls: failed to parse certificate
PEM data")
return
}

because your certificate has a different PEM header than Go is expecting
(it expects "BEGIN CERTIFICATE", yours says "BEGIN TRUSTED CERTIFICATE").

I started looking into why your cert says that, what happens if you hack it
to make Go look at it anyway, etc, but I'm out of time right now. Perhaps
this reply will nudge you in the right direction anyway. :)

-jeff

--

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 9 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 14, '13 at 8:12a
activeJan 16, '13 at 11:39a
posts9
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase