Skip to content

Commit

Permalink
Fix "SSL Handshake failed" issue
Browse files Browse the repository at this point in the history
- Add security.protocol as quarkus runtime options and allow replaying
  the option as runtime init
- Enable enableAllSecurityServices when building the native image for
  the integration test
  • Loading branch information
vietk authored and geoand committed Jun 22, 2020
1 parent 75914f6 commit daf56bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public class KafkaStreamsRuntimeConfig {
@ConfigItem
public Optional<String> schemaRegistryUrl;

/**
* The security protocol to use
* See https://docs.confluent.io/current/streams/developer-guide/security.html#security-example
*/
@ConfigItem(name = "security.protocol")
public Optional<String> securityProtocol;

/**
* The SASL JAAS config.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import org.apache.kafka.clients.CommonClientConfigs;
import org.apache.kafka.clients.admin.AdminClient;
import org.apache.kafka.clients.admin.AdminClientConfig;
import org.apache.kafka.clients.admin.ListTopicsResult;
Expand Down Expand Up @@ -113,6 +114,9 @@ private static Properties getStreamsProperties(Properties properties, String boo
streamsProperties.put(runtimeConfig.schemaRegistryKey, runtimeConfig.schemaRegistryUrl.get());
}

// set the security protocol (in case we are doing PLAIN_TEXT)
setProperty(runtimeConfig.securityProtocol, streamsProperties, CommonClientConfigs.SECURITY_PROTOCOL_CONFIG);

// sasl
SaslConfig sc = runtimeConfig.sasl;
if (sc != null) {
Expand Down
1 change: 1 addition & 0 deletions integration-tests/kafka-streams/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<cleanupServer>true</cleanupServer>
<enableHttpUrlHandler>true</enableHttpUrlHandler>
<graalvmHome>${graalvmHome}</graalvmHome>
<enableAllSecurityServices>true</enableAllSecurityServices>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit daf56bf

Please sign in to comment.