You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/07 18:13:22 UTC

[GitHub] markusthoemmes commented on a change in pull request #3258: Encrypt data in motion - Kafka

markusthoemmes commented on a change in pull request #3258: Encrypt data in motion - Kafka
URL: https://github.com/apache/incubator-openwhisk/pull/3258#discussion_r166706508
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/connector/kafka/KafkaMessagingProvider.scala
 ##########
 @@ -84,4 +102,14 @@ object KafkaConfiguration {
   def configMapToKafkaConfig(configMap: Map[String, String]) = configMap.map {
     case (key, value) => configToKafkaKey(key) -> value
   }
+
+  def useSSL(props: Properties, httpsConfig: KafkaSslConfig) = {
+    props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL")
+    props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, httpsConfig.truststorePath)
+    props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, httpsConfig.truststorePassword)
+  }
+  def authenticateUser(props: Properties, httpsConfig: KafkaSslConfig) = {
+    props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, httpsConfig.keystorePath)
+    props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, httpsConfig.keystorePassword)
+  }
 
 Review comment:
   I lately did an effort to generalize all the kafka settings for the producer into `whisk.kafka.producer`. Could we introduce a `whisk.kafka.clients` or `whisk.kafka.common` which includes settings needed for both the producer and consumer?
   
   I modeled it in a way so that we can just throw in the keys from the Kafka config itself and override anything we want from application.conf without needing code changes. Do you think that's feasible here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services