Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim spaces of the certificate before loading #33

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

larryzju
Copy link
Contributor

@larryzju larryzju commented Jun 30, 2023

The parse failed when the certificate has extra spaces/newlines at the end of the file. And the error message is confusing

$ cat ca.crt | certinfo
--- [stdin] ---
file stdin: cannot find any PEM block

Call TrimSpace before reading the certificate.

@pete911 pete911 merged commit e4f55fb into pete911:main Jun 30, 2023
@pete911
Copy link
Owner

pete911 commented Jun 30, 2023

Hi @larryzju, thanks for the fix! I added test as well and released it (v1.0.18).

jonhadfield pushed a commit to jonhadfield/certinfo that referenced this pull request Jul 2, 2023
@larryzju larryzju deleted the trim-spaces branch July 3, 2023 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants