-
Notifications
You must be signed in to change notification settings - Fork 15k
KAFKA-3665: Enable TLS hostname verification by default (KIP-294) #4956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -472,7 +472,7 @@ public void testUnauthenticatedApiVersionsRequestOverSslHandshakeVersion0() thro | |
| */ | ||
| @Test | ||
| public void testUnauthenticatedApiVersionsRequestOverSslHandshakeVersion1() throws Exception { | ||
| testUnauthenticatedApiVersionsRequest(SecurityProtocol.SASL_PLAINTEXT, (short) 1); | ||
| testUnauthenticatedApiVersionsRequest(SecurityProtocol.SASL_SSL, (short) 1); | ||
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -1466,7 +1466,7 @@ private NioEchoServer createEchoServer(ListenerName listenerName, SecurityProtoc | |
|
|
||
| private void createClientConnection(SecurityProtocol securityProtocol, String node) throws Exception { | ||
| createSelector(securityProtocol, saslClientConfigs); | ||
| InetSocketAddress addr = new InetSocketAddress("127.0.0.1", server.port()); | ||
| InetSocketAddress addr = new InetSocketAddress("localhost", server.port()); | ||
| selector.connect(node, addr, BUFFER_SIZE, BUFFER_SIZE); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,11 +173,13 @@ object ConfigCommand extends Config { | |
| private[admin] def parseConfigsToBeAdded(opts: ConfigCommandOptions): Properties = { | ||
| val props = new Properties | ||
| if (opts.options.has(opts.addConfig)) { | ||
| //split by commas, but avoid those in [], then into KV pairs | ||
| // Split list by commas, but avoid those in [], then into KV pairs | ||
| // Each KV pair is of format key=value, split them into key and value, using -1 as the limit for split() to | ||
| // include trailing empty strings. This is to support empty value (e.g. 'ssl.endpoint.identification.algorithm=') | ||
| val pattern = "(?=[^\\]]*(?:\\[|$))" | ||
| val configsToBeAdded = opts.options.valueOf(opts.addConfig) | ||
| .split("," + pattern) | ||
| .map(_.split("""\s*=\s*""" + pattern)) | ||
| .map(_.split("""\s*=\s*""" + pattern, -1)) | ||
|
||
| require(configsToBeAdded.forall(config => config.length == 2), "Invalid entity config: all configs to be added must be in the format \"key=val\".") | ||
| //Create properties, parsing square brackets from values if necessary | ||
| configsToBeAdded.foreach(pair => props.setProperty(pair(0).trim, pair(1).replaceAll("\\[?\\]?", "").trim)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the value is set to
nullinstead of empty string?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty string and
nullare handled in the same way, updated test to verify that as well.