Merge pull request #9 from mholt/patch-2

Fix panic
This commit is contained in:
xenolf 2015-10-18 05:04:20 +02:00
commit d322fc0c7e

View file

@ -33,7 +33,7 @@ func pemEncode(data interface{}) []byte {
pemBlock = &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key)}
break
case derCertificateBytes:
pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: data.([]byte)}
pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: []byte(data.(derCertificateBytes))}
}
return pem.EncodeToMemory(pemBlock)