[FLINK-34369][connectors/elasticsearch] Elasticsearch connector supports SSL context
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.
Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html)
@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 NetworkClientConfig has a setting:
- allowInsecure: boolean (uses trustall model in case of self-signed certs)
- you could certainly also keep more elaborate configuration with SSLContext / SSLEngine / ... in case it is needed
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 allowInsecure and the sslContextSupplier are mutually exclusive, so I added some validation and unit test for that. I can work on a separate on for table if this looks right.
@liuml07 thanks for the contribution
it seems the ci failed because of spotless
could you please apply spotless to the PR?
@reta may I ask you to have another review iteration please?
Thanks for reviewing and your approval. Could you help merge this @reta?
Thanks for the contribution @liuml07 Thanks for the review @reta
Awesome work, congrats on your first merged pull request!