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

api: Add byte[] methods for Trust/KeyManager Channel Credentials API #11491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

josalmi
Copy link

@josalmi josalmi commented Aug 23, 2024

The TlsChannelCredentials.Builder reads all keyManager and trustManager overloaded input params to byte[] already. Add an option to pass byte[] directly.

Might make sense to do similar changes to: TlsServerCredentials.

Copy link

linux-foundation-easycla bot commented Aug 23, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@ejona86
Copy link
Member

ejona86 commented Aug 23, 2024

How are you getting your certs/keys such that they are byte[]?

@josalmi
Copy link
Author

josalmi commented Aug 23, 2024

As a Base64 encoded Environment Variables running in a container based setup: Base64.getDecoder().decode(envVar). I can of course wrap the byte[] in a new ByteArrayInputStream() with practically no overhead since it's a one time thing.

@ejona86
Copy link
Member

ejona86 commented Aug 23, 2024

Storing secrets in env vars is not something to encourage, but I do see how that's the path of least resistance and may not be a problem in some environments. Converting to InputStream is easy, except you have to catch the impossible IOException. Adding the byte[] methods are easy, but I'd feel better if we had a stronger or more frequent use case.

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