-
Notifications
You must be signed in to change notification settings - Fork 85
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
[FLINK-34369][connectors/elasticsearch] Elasticsearch connector supports SSL context #91
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html) |
d5707c3
to
ede5bb8
Compare
@liuml07 could you please use the same configuration/API model as [1] does for SSL support in OpenSearch? Besides just having familiar configuration, the API is friendly to SQL connector (where providing hostname verifier could be challenging), thank you. The idea basically is that
Thank you. [1] https://github.com/apache/flink-connector-opensearch/tree/main/flink-connector-opensearch |
@reta Thanks for the advice. I have updated the patch accordingly. I think the |
@liuml07 thanks for the contribution |
@reta may I ask you to have another review iteration please? |
*/ | ||
public B setAllowInsecure(boolean allowInsecure) { | ||
this.allowInsecure = allowInsecure; | ||
return self(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is overlap between this setting and suppliers, you may just rely on SSL context supplier here:
this.allowInsecure = allowInsecure;
if (this.allowInsecure) {
return setSslContextSupplier(SSLContexts.custom().loadTrustMaterial(TrustAllStrategy.INSTANCE)::build);
}
|
||
final CredentialsProvider credentialsProvider = getCredentialsProvider(networkClientConfig); | ||
if (credentialsProvider != null | ||
|| networkClientConfig.isAllowInsecure().orElse(Boolean.FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think wiring allowInsecure
through sslContextSupplier (here https://github.com/apache/flink-connector-elasticsearch/pull/91/files#r1574279683) would make the logic simpler
Thanks for reviewing and your approval. Could you help merge this @reta? |
Awesome work, congrats on your first merged pull request! |
https://issues.apache.org/jira/browse/FLINK-34369
02/05/2024
This is a preliminary PR that was tested locally with secure ES clusters. Plan is to get early feedback, add some tests, and test with deployed jobs.