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

feat(transport): add mTLS for Kafka #367

Merged
merged 5 commits into from
Dec 31, 2024
Merged

feat(transport): add mTLS for Kafka #367

merged 5 commits into from
Dec 31, 2024

Conversation

lspgn
Copy link
Member

@lspgn lspgn commented Dec 26, 2024

Adds TLS configuration for client certificate.
Closes #363

@coredump17
Copy link

hi @lspgn, can we have an option to add server CA to trust also. getting error="kafka: client has run out of available brokers to talk to: tls: failed to verify certificate: x509: certificate signed by unknown authority for kafka transport" when trying to test.

@lspgn
Copy link
Member Author

lspgn commented Dec 27, 2024

Try now

@coredump17
Copy link

@lspgn
level=ERROR msg="error transporter" error="error reading server CA: read truststore.crt: file already closed for kafka transport"

@lspgn
Copy link
Member Author

lspgn commented Dec 29, 2024

Ah sorry, misplaced a statement and didn't have the proper test bed. Could you retry now?

@coredump17
Copy link

Hi @lspgn, thanks for your help on this. I am failing to load a CA cert. I have tried a few different ones, in PEM format but keep getting this error: =ERROR msg="error transporter" error="error parsing server CA: x509: malformed certificate for kafka transport". This truststore works fine with pmacct so believe the file is good.

@lspgn
Copy link
Member Author

lspgn commented Dec 30, 2024

Will have a look. Might be due to the PEM encoding. Would you be able to try directly in a DER binary format?

@lspgn
Copy link
Member Author

lspgn commented Dec 30, 2024

This should be fixed. It was indeed missing pem decoding.

Made a test TLS server for me to test:

socat OPENSSL-LISTEN:9093,cert=cert.crt,key=privkey.pem,verify=0,fork STDIO

@coredump17
Copy link

Will have a look. Might be due to the PEM encoding. Would you be able to try directly in a DER binary format?

yes, DER works ;).

@coredump17
Copy link

i can confirm PEM now works with your new amendment. thanks a lot!

@lspgn lspgn merged commit 99f3629 into main Dec 31, 2024
1 check passed
@lspgn lspgn deleted the lspgn/kafkamtls branch December 31, 2024 16:23
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.

Transport Kafka - support mTLS
2 participants