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

exec: ensure certs always end with a new line #1096

Merged
merged 2 commits into from Dec 6, 2022

Conversation

goenning
Copy link
Contributor

@goenning goenning commented Dec 3, 2022

Signed-off-by: goenning me@goenning.net

Motivation

While testing it changes from #1089, I got this error:

1: failed to deserialize PEM-encoded chain of certificates: error:0908F066:PEM routines:get_header_and_data:bad end line:crypto/pem/pem_lib.c:856:

It worked on kubectl, but not on kube-rs.

Solution

After some digging I noticed that PEM-encoded was missing a \n at the end, which seems to be what OpenSSL expects. Apparently Go is a bit more flexible with this and it's ok to not end with a new line.

This PR ensures that certs always end with a new line. OpenSSL doesn't seem to care about ending with double new lines, so this PR simply appends a new line regardless if it already ends in one. Alternatively we could check before pushing.

Signed-off-by: goenning <me@goenning.net>
@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2022

Codecov Report

Merging #1096 (cb9915a) into main (b60202c) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1096      +/-   ##
==========================================
- Coverage   72.62%   72.59%   -0.04%     
==========================================
  Files          65       65              
  Lines        4819     4821       +2     
==========================================
  Hits         3500     3500              
- Misses       1319     1321       +2     
Impacted Files Coverage Δ
kube-client/src/client/config_ext.rs 48.07% <0.00%> (-1.93%) ⬇️

@clux clux added the changelog-fix changelog fix category for prs label Dec 4, 2022
@clux clux added this to the 0.77.0 milestone Dec 4, 2022
@clux clux merged commit 6c87ffe into kube-rs:main Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-fix changelog fix category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants