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

Add support to use PEM string for SSL #3868

Merged

Conversation

stephen37
Copy link
Contributor

@stephen37 stephen37 commented Jan 18, 2022

What this PR does / why we need it:
Make it possible to use CA certificate string (PEM format) for verifying the broker's key,
Client's private key string (PEM format) used for authentication and Client's public key string (PEM format) used for authentication.

Without that, it is only possible to use SSL with path to files for PEM.
Which issue(s) this PR fixes:

Fixes #3867

Special notes for your reviewer:
I'm gonna add some documentation later :)

Make it possible to use CA certificate string (PEM format) for verifying the broker's key,
Client's private key string (PEM format) used for authentication and Client's public key string (PEM format) used for authentication.
@seldondev
Copy link
Collaborator

Hi @stephen37. Thanks for your PR.

I'm waiting for a SeldonIO or todo member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository.

@seldondev
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign majolo
You can assign the PR to them by writing /assign @majolo in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

ClientCertFile: GetEnv("KAFKA_SSL_CLIENT_CERT_FILE", ""),
ClientKeyFile: GetEnv("KAFKA_SSL_CLIENT_KEY_FILE", ""),
CACertFile: GetEnv("KAFKA_SSL_CA_CERT_FILE", ""),
ClientKeyPass: GetEnv("KAFKA_SSL_CLIENT_KEY_PASS", ""),
// Optional password
ClientKeyPass: GetEnv("KAFKA_SSL_CLIENT_KEY_PASS", ""),
Copy link
Contributor

@ukclivecox ukclivecox Jan 18, 2022

Choose a reason for hiding this comment

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

I assume if password is set to empty string as no env setting its ok later when its set in Kafka options? Will it be ignored?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it will be ignored 😃 It has been tested in the worker_test.go file

@ukclivecox
Copy link
Contributor

@stephen37 failing some tests.

@stephen37
Copy link
Contributor Author

@cliveseldon Yes tests won't work because the version of Kafka is too old, I can't fix the test until we use v1.8.2. The error is No such configuration property: \"ssl.ca.pem\ in the test.

@ukclivecox
Copy link
Contributor

@cliveseldon Yes tests won't work because the version of Kafka is too old, I can't fix the test until we use v1.8.2. The error is No such configuration property: \"ssl.ca.pem\ in the test.

OK so will you add a PR for that so we can get in and rebase?

@stephen37
Copy link
Contributor Author

Sure, here is the PR #3870, I just assumed it would be more complicated than that to upgrade. Also the tests work locally 🙌

@stephen37
Copy link
Contributor Author

Ah I guess I need you yo do something so that we can check if tests pass now @cliveseldon.

@stephen37
Copy link
Contributor Author

Yaaay tests are passing now 🎉 Only the documentation tests are failing but it seems like they are not working at the moment.

@ukclivecox
Copy link
Contributor

/test integration

@ukclivecox
Copy link
Contributor

/test notebooks

@ukclivecox
Copy link
Contributor

@stephen37 Looks good will run longer integration test. There are 1 or 2 flaky ones so lets see how they go. And yes docs tests seems to have an issue at present.

@stephen37
Copy link
Contributor Author

The integration test failed but I don't have access to it, how can I check what failed? @cliveseldon

@ukclivecox
Copy link
Contributor

/test integration

@ukclivecox
Copy link
Contributor

@stephen37 it failed during test setup. We are looking to see if we can open up the logs without auth but for now will rerun tests. There are a couple of flaky tests so if its just those we can proceed as notebook tests succeed.

@seldondev
Copy link
Collaborator

@stephen37: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
integration d179fbe link /test integration

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository. I understand the commands that are listed here.

@ukclivecox
Copy link
Contributor

As just 2 tests failing in integration but we know these have issues can merge. Thanks @stephen37

@ukclivecox ukclivecox merged commit 8eaf8fe into SeldonIO:master Jan 27, 2022
@stephen37 stephen37 deleted the add_support_string_ssl_certificates branch January 27, 2022 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support using SSL with PEM strings
3 participants