Closed cwjohnston closed 1 year ago
Handler errors when provided a PEM formatted CA certificate
handler can read PEM formatted certificates
handler usage indicates CA certificate should be in PEM format, but prints an error when a PEM formatted CA cert is provided:
error executing handler: invalid sensu-ca-cert: asn1: structure error: tags don't match
It appears x509.ParseCertificate called at https://github.com/sensu/sensu-puppet-handler/blob/0.2.0/main.go#L272 expects to read in ASN1 DER format.
Translating the CA certificate to DER solves the problem, but is neither convenient nor consistent with the usage documentation.
Looks like a community user addressed this in https://github.com/mrtrotl/sensu-puppet-handler. Can we merge the changes back and push a new release @portertech ?
Closed by #7
Description
Handler errors when provided a PEM formatted CA certificate
Expected behavior
handler can read PEM formatted certificates
Current behavior
handler usage indicates CA certificate should be in PEM format, but prints an error when a PEM formatted CA cert is provided:
error executing handler: invalid sensu-ca-cert: asn1: structure error: tags don't match
Context
It appears x509.ParseCertificate called at https://github.com/sensu/sensu-puppet-handler/blob/0.2.0/main.go#L272 expects to read in ASN1 DER format.
Translating the CA certificate to DER solves the problem, but is neither convenient nor consistent with the usage documentation.