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

fix: pass mTLS certificates correctly (TypeListToStringSlice shouldn't quote special characters) #172

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

ligfx
Copy link
Contributor

@ligfx ligfx commented Oct 16, 2024

When calling it on actual strings, the string gets quoted and special characters like newlines are escaped. It was trimming the quotes but not fixing escaped characters. This was messing up passing mTLS PEM-format certificates, which contain newlines.

Change the logic if called on a types.List that has actual types.String values so we keep the exact string value. Ideally this function is somehow typed so it can only ever be called on types.List that have strings but that seems like a bigger project.

When calling it on actual strings, the string gets quoted and
special characters like newlines are escaped. It was trimming
the quotes but not fixing escaped characters. This was messing
up passing mTLS PEM-format certificates, which contain newlines.

Change the logic if called on a types.List that has actual types.String
values so we keep the exact string value. Ideally this function is somehow
typed so it can only ever be called on types.List that have strings but
that seems like a bigger project.
Copy link
Contributor

@gene-redpanda gene-redpanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gene-redpanda gene-redpanda merged commit b1c4d5e into redpanda-data:main Nov 6, 2024
10 checks passed
@ligfx ligfx deleted the fix_mtls_certs branch November 8, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants