Open jiri-lazensky opened 7 months ago
Yeah, that's probably the issue. Basically if there's an extra character after the last parsed PEM it attempts to parse again.
if rest
is composed of whitespace only should we just ignore it?
@joe-elliott I guess that would work also 👍. I went with simplest sanitation I could think of without touching the cert parsing itself.
yeah, if you're up for a PR i think just ignoring whitespace would be better that way we'd catch similar future issues
Is there something blocking a patch release to roll this out?
Nope. I actually thought this was in a release. I will get one cut soon to catch the fixes and improvements that have been added since
https://github.com/joe-elliott/cert-exporter/releases/tag/v2.12.0
Cert-exporter can't process certificates that ends with new line.
Error example:
I believe that this line is the "cause".
https://github.com/joe-elliott/cert-exporter/blob/28bb9e554f835f8940f89e2390b9bc205c76f100/src/exporters/certHelpers.go#L101
In my fork I have solved it by adding function that will remove all new lines from the end of file - https://github.com/joe-elliott/cert-exporter/compare/master...jiri-lazensky:cert-exporter:feat-remove-newline-from-end-of-the-cert.
Please let me know if you consider this as an issue, or if you expect that certificates will end without new line char, thanks!