sensu / sensu-puppet-handler

Deregister Sensu entities without an associated Puppet node
MIT License
0 stars 5 forks source link

Error when CA certificate is provided in PEM format #3

Closed cwjohnston closed 1 year ago

cwjohnston commented 4 years ago

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.

asachs01 commented 1 year ago

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 ?

asachs01 commented 1 year ago

Closed by #7