reta commented on code in PR #91:
URL:
https://github.com/apache/flink-connector-elasticsearch/pull/91#discussion_r1574288489
##########
flink-connector-elasticsearch-base/src/main/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchWriter.java:
##########
@@ -161,17 +166,46 @@ private static RestClientBuilder
configureRestClientBuilder(
if (networkClientConfig.getConnectionPathPrefix() != null) {
builder.setPathPrefix(networkClientConfig.getConnectionPathPrefix());
}
- if (networkClientConfig.getPassword() != null
- && networkClientConfig.getUsername() != null) {
- final CredentialsProvider credentialsProvider = new
BasicCredentialsProvider();
- credentialsProvider.setCredentials(
- AuthScope.ANY,
- new UsernamePasswordCredentials(
- networkClientConfig.getUsername(),
networkClientConfig.getPassword()));
+
+ final CredentialsProvider credentialsProvider =
getCredentialsProvider(networkClientConfig);
+ if (credentialsProvider != null
+ || networkClientConfig.isAllowInsecure().orElse(Boolean.FALSE)
Review Comment:
I think wiring `allowInsecure` through sslContextSupplier (here
https://github.com/apache/flink-connector-elasticsearch/pull/91/files#r1574279683)
would make the logic simpler
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]