Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,15 @@ schemas before selecting canonical `false`; `true` allows automatic registration
Light's own Avro serializer retains its legacy fallback for handwritten old-key
configurations, with the canonical key taking precedence. Users relying on that
fallback must also migrate their values overrides to retain a `false` setting.

## Kafka TLS endpoint identification (#265)

Generated producer, consumer and Streams TLS examples now show `https` for
`ssl.endpoint.identification.algorithm`. The lines remain commented, preserving
Kafka's native hostname-verification default until explicitly enabled. If an
older generated example was uncommented, replace its `algo-name` value or
external override with `https`; `algo-name` is not a valid Java identification
algorithm and fails a TLS handshake. The `kafka-*.ssl.endpoint.identification.algorithm`
keys remain unchanged. An explicitly configured empty string disables hostname
verification; it is not the default. Certificates must match the broker hostname.
The generation regression covers both generators and all eight Kafka flag combinations.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ properties:
# sasl.jaas.config: "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"${kafka-consumer.username:username}\" password=\"${kafka-consumer.password:password}\";"
# ssl.truststore.location: ${kafka-consumer.ssl.truststore.location:/truststore/kafka.server.truststore.jks}
# ssl.truststore.password: ${kafka-consumer.ssl.truststore.password:changeme}
# ssl.endpoint.identification.algorithm: ${kafka-consumer.ssl.endpoint.identification.algorithm:algo-name}
# ssl.endpoint.identification.algorithm: ${kafka-consumer.ssl.endpoint.identification.algorithm:https}
# Apache Kafka 2.3 clients or later will then read from followers that have matching broker.rack as the specified client.rack ID.
# client.rack: ${kafka-consumer.client.rack:rack-name}
# basic authentication user:pass for the schema registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ properties:
# security.protocol: ${kafka-producer.security.protocol:SASL_SSL}
# sasl.mechanism: ${kafka-producer.sasl.mechanism:PLAIN}
# sasl.jaas.config: "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"${kafka-producer.username:username}\" password=\"${kafka-producer.password:password}\";"
# ssl.endpoint.identification.algorithm: ${kafka-producer.ssl.endpoint.identification.algorithm:algo-name}
# ssl.endpoint.identification.algorithm: ${kafka-producer.ssl.endpoint.identification.algorithm:https}
# ssl.truststore.location: ${kafka-producer.ssl.truststore.location:/truststore/kafka.server.truststore.jks}
# ssl.truststore.password: ${kafka-producer.ssl.truststore.password:changeme}
# client.rack: ${kafka-producer.client.rack:rack-name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ properties:
# security.protocol: ${kafka-streams.security.protocol:SASL_SSL}
# sasl.mechanism: ${kafka-streams.sasl.mechanism:PLAIN}
# sasl.jaas.config: "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"${kafka-streams.username:username}\" password=\"${kafka-streams.password:password}\";"
# ssl.endpoint.identification.algorithm: ${kafka-streams.ssl.endpoint.identification.algorithm:algo-name}
# ssl.endpoint.identification.algorithm: ${kafka-streams.ssl.endpoint.identification.algorithm:https}
# Apache Kafka 2.3 clients or later will then read from followers that have matching broker.rack as the specified client.rack ID.
# client.rack: ${kafka-streams.client.rack:rack-name}
# basic authentication user:pass for the schema registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ private void assertConfigsAndValues(Path directory, Set<String> expectedClients)
String placeholder = "${" + client + ".auto.register.schemas:true}";
assertTrue(yaml.contains("auto.register.schemas: " + placeholder), path.toString());
assertFalse(yaml.contains("schema.registry.auto.register.schemas"), path.toString());
String tlsKey = client + ".ssl.endpoint.identification.algorithm";
String tlsPlaceholder = "${" + tlsKey + ":https}";
assertTrue(yaml.contains("# ssl.endpoint.identification.algorithm: " + tlsPlaceholder), path.toString());
assertFalse(yaml.contains(":algo-name}"), path.toString());
ConfigInjection.setDecryptedValueMap(new HashMap<>());
assertEquals("https", ConfigInjection.getInjectValue(tlsPlaceholder, true));
ConfigInjection.setDecryptedValueMap(new HashMap<>(Map.of(tlsKey, "")));
assertEquals("", ConfigInjection.getInjectValue(tlsPlaceholder, true));

ConfigInjection.setDecryptedValueMap(new HashMap<>(Map.of(client + ".schema.registry.auto.register.schemas", false)));
assertEquals(true, ConfigInjection.getInjectValue(placeholder, true), "Old names require explicit migration");
ConfigInjection.setDecryptedValueMap(new HashMap<>(Map.of(client + ".auto.register.schemas", false)));
Expand Down