You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "m1a2st (via GitHub)" <gi...@apache.org> on 2025/08/19 14:51:19 UTC
[PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
m1a2st opened a new pull request, #20376:
URL: https://github.com/apache/kafka/pull/20376
The new test framework does not yet support the SASL_SSL security protocol; we should add support for it.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3173917045
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
Good suggestion @chia7712, this is an attractive idea. The issue is that if we make it generic, without any dependency on Kafka, then it cannot house TestSslUtils.
The purpose of TestSslUtils is to generate certificates and configuration to test SSL in Kafka specifically. Precisely what we need for our test framework, AFAICT. So it depends on classes from `clients`: SslConfigs, Password, DefaultSslEngineFactory, ConnectionMode, which we would need anyway. Not just for the new test framework, but also probably for any other use within this repository: would we ever generate keys and certificates for something other than Kafka? It seems to me these two things want to live together.
If we move TestSslUtils to a new module, it would have to depend on `clients` too, it couldn't be "zero-kafka". The benefit here is that the modules that require this new dependency would not be adding clients' _test_ classpath, only the main classpath. Right now, I can't tell how significant this is. I'd still like to understand the classpath leakage concern. A concrete example would help.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3168439097
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
Thanks for the reply.
> Since test-common-runtime is to be used as shared test infrastructure, it cannot depend on the clients test classpath, as that would introduce an invalid dependency.
What makes that dependency invalid?
Currently, `:test-common:test-common-runtime` [already depends on `:clients`](https://github.com/apache/kafka/blob/trunk/build.gradle#L1636), it's just missing the client tests classpath.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20376:
URL: https://github.com/apache/kafka/pull/20376#issuecomment-4028541733
This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.
<p>
If you are having difficulty finding a reviewer, please reach out on the
[mailing list](https://kafka.apache.org/contact).
<p>
If this PR is no longer valid or desired, please feel free to close it. If no activity
occurs in the next 30 days, it will be automatically closed.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3202917565
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/SslManager.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.SslConfigs;
+import org.apache.kafka.common.network.ConnectionMode;
+import org.apache.kafka.common.utils.Utils;
+import org.apache.kafka.test.TestSslUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.Map;
+
+public class SslManager {
+
+ private static final Logger log = LoggerFactory.getLogger(SslManager.class);
+ private File keyStoreFile;
+ private final File trustStoreFile;
+
+ public SslManager() {
+ try {
+ trustStoreFile = org.apache.kafka.test.TestUtils.tempFile("kafka.server.truststore", ".jks");
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to create truststore file", e);
+ }
+ }
+
+ public Map<String, Object> createSslConfig() {
+ try {
+ Map<String, Object> config = new TestSslUtils.SslConfigsBuilder(ConnectionMode.SERVER)
+ .createNewTrustStore(trustStoreFile)
+ .build();
+ keyStoreFile = new File((String) config.get(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG));
+ log.info("Created unified SSL config - KeyStore: {}, TrustStore: {}", keyStoreFile.getPath(), trustStoreFile.getPath());
+ return config;
+ } catch (IOException | GeneralSecurityException e) {
+ throw new RuntimeException("Failed to create SSL config", e);
+ }
+ }
+
+ public String trustStoreLocation() {
+ return trustStoreFile != null ? trustStoreFile.getAbsolutePath() : null;
+ }
Review Comment:
@m1a2st For the server, we're taking the config properties from SslConfigsBuilder, but for the client we are not. Could we use SslConfigsBuilder to generate the client configuration too using `ConnectionMode.SERVER` and `useExistingTrustStore` ?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3174036635
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
> So it depends on classes from clients: SslConfigs, Password, DefaultSslEngineFactory, ConnectionMode, which we would need anyway. Not just for the new test framework, but also probably for any other use within this repository: would we ever generate keys and certificates for something other than Kafka? It seems to me these two things want to live together.
I believe connecting to the clients module should be fine, as it is essentially the foundation of Kafka
> Right now, I can't tell how significant this is. I'd still like to understand the classpath leakage concern. A concrete example would help.
For example, users could use the cluster instance as an embedded Kafka, which is useful not only for testing but also for POCs. Therefore, depending on the test module would be an anti-pattern here.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez merged PR #20376:
URL: https://github.com/apache/kafka/pull/20376
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3196724410
##########
test-common/test-common-runtime/src/test/java/org/apache/kafka/common/test/junit/ClusterTestExtensionsTest.java:
##########
@@ -526,6 +526,23 @@ public void testSaslPlaintext(ClusterInstance clusterInstance) throws Cancellati
}
)
public void testSaslPlaintextWithController(ClusterInstance clusterInstance) throws CancellationException, ExecutionException, InterruptedException {
+ testSecurityProtocol(clusterInstance);
+ }
+
+ @ClusterTest(
+ types = {Type.KRAFT, Type.CO_KRAFT},
+ brokerSecurityProtocol = SecurityProtocol.SASL_SSL,
+ controllerSecurityProtocol = SecurityProtocol.SASL_SSL,
+ serverProperties = {
+ @ClusterConfigProperty(key = GroupCoordinatorConfig.OFFSETS_TOPIC_PARTITIONS_CONFIG, value = "1"),
+ @ClusterConfigProperty(key = GroupCoordinatorConfig.OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG, value = "1")
+ }
+ )
+ public void testSaslSslWithController(ClusterInstance clusterInstance) throws CancellationException, ExecutionException, InterruptedException {
+ testSecurityProtocol(clusterInstance);
+ }
Review Comment:
This test will pass regardless of whether the cluster is configured with `SASL_SSL` or `SASL_PLAINTEXT`. One possible way to check if the cluster is really using the correct security protocol is to check the brokers on the cluster instance, and the data plane acceptors in their socket servers.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3195210803
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/SslManager.java:
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.SslConfigs;
+import org.apache.kafka.common.config.types.Password;
+import org.apache.kafka.common.utils.Utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.KeyPair;
+import java.security.cert.X509Certificate;
+import java.util.List;
+import java.util.Map;
+
+public class SslManager {
+
+ private static final Logger log = LoggerFactory.getLogger(SslManager.class);
+ private final File keyStoreFile;
+ private final File trustStoreFile;
+ public static final String CLUSTER_TRUSTSTORE_PASSWORD = "cluster-truststore-password";
+
+ public SslManager() {
+ try {
+ keyStoreFile = TestUtils.tempFile("kafka.cluster.keystore", ".jks");
+ trustStoreFile = TestUtils.tempFile("kafka.server.truststore", ".jks");
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to create keystore or truststore file", e);
+ }
+ }
+
+ public Map<String, Object> createSslConfig() {
+ try {
+ KeyPair clusterKeyPair = TestSslUtils.generateKeyPair("RSA");
+ String[] hostNames = {"localhost", "127.0.0.1"};
+ X509Certificate clusterCert = TestSslUtils.generateSignedCertificate(
+ "CN=kafka-cluster, O=Kafka Test Cluster",
+ clusterKeyPair,
+ 0,
+ 365,
+ null,
+ null,
+ "SHA256withRSA",
+ false,
+ true,
+ true,
+ hostNames
+ );
+
+ Password keyStorePassword = new Password("cluster-keystore-password");
+ Password keyPassword = new Password("cluster-key-password");
+
+ TestSslUtils.createKeyStore(
+ keyStoreFile.getPath(),
+ keyStorePassword,
+ keyPassword,
+ "kafka-cluster",
+ clusterKeyPair.getPrivate(),
+ clusterCert
+ );
+
+ Password trustStorePassword = new Password(CLUSTER_TRUSTSTORE_PASSWORD);
+ TestSslUtils.createTrustStore(
Review Comment:
Thanks, I have updated this patch.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3196785745
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/SslManager.java:
##########
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.SslConfigs;
+import org.apache.kafka.common.config.types.Password;
+import org.apache.kafka.common.utils.Utils;
+import org.apache.kafka.test.TestSslUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.KeyPair;
+import java.security.cert.X509Certificate;
+import java.util.List;
+import java.util.Map;
+
+public class SslManager {
+
+ private static final Logger log = LoggerFactory.getLogger(SslManager.class);
+ private final File keyStoreFile;
+ private final File trustStoreFile;
+ public static final String CLUSTER_TRUSTSTORE_PASSWORD = "cluster-truststore-password";
+
+ public SslManager() {
+ try {
+ keyStoreFile = TestUtils.tempFile("kafka.cluster.keystore", ".jks");
+ trustStoreFile = TestUtils.tempFile("kafka.server.truststore", ".jks");
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to create keystore or truststore file", e);
+ }
+ }
+
+ public Map<String, Object> createSslConfig() {
+ try {
+ KeyPair clusterKeyPair = TestSslUtils.generateKeyPair("RSA");
+ String[] hostNames = {"localhost", "127.0.0.1"};
+ X509Certificate clusterCert = TestSslUtils.generateSignedCertificate(
+ "CN=kafka-cluster, O=Kafka Test Cluster",
+ clusterKeyPair,
+ 0,
+ 365,
+ null,
+ null,
+ "SHA256withRSA",
+ false,
+ true,
+ true,
+ hostNames
+ );
+
+ Password keyStorePassword = new Password("cluster-keystore-password");
+ Password keyPassword = new Password("cluster-key-password");
+
+ TestSslUtils.createKeyStore(
+ keyStoreFile.getPath(),
+ keyStorePassword,
+ keyPassword,
+ "kafka-cluster",
+ clusterKeyPair.getPrivate(),
+ clusterCert
+ );
+
+ Password trustStorePassword = new Password(CLUSTER_TRUSTSTORE_PASSWORD);
+ TestSslUtils.createTrustStore(
+ trustStoreFile.getPath(),
+ trustStorePassword,
+ Map.of("kafka-cluster", clusterCert)
+ );
+ log.info("Created unified SSL config - KeyStore: {}, TrustStore: {}", keyStoreFile.getPath(), trustStoreFile.getPath());
+ return Map.ofEntries(
+ Map.entry(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, keyStoreFile.getPath()),
+ Map.entry(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, keyStorePassword),
+ Map.entry(SslConfigs.SSL_KEY_PASSWORD_CONFIG, keyPassword),
+ Map.entry(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "JKS"),
+
+ Map.entry(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, trustStoreFile.getPath()),
+ Map.entry(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, trustStorePassword),
+ Map.entry(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, "JKS"),
+
+ Map.entry(SslConfigs.SSL_PROTOCOL_CONFIG, "TLSv1.2"),
+ Map.entry(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, List.of("TLSv1.2")),
+
+ Map.entry(SslConfigs.SSL_KEYMANAGER_ALGORITHM_CONFIG, "SunX509"),
+ Map.entry(SslConfigs.SSL_TRUSTMANAGER_ALGORITHM_CONFIG, "PKIX"),
+ Map.entry(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, "")
Review Comment:
`TestSslUtils.SslConfigsBuilder` already sets up the SSL configuration properties , can we use that here?
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestUtils.java:
##########
@@ -55,7 +55,16 @@ class TestUtils {
* suffix to generate its name.
*/
public static File tempFile() throws IOException {
- final File file = Files.createTempFile("kafka", ".tmp").toFile();
+ return tempFile("kafka", ".tmp");
+ }
+
+ /**
+ * Create an empty file in the default temporary-file directory, using the given prefix and suffix
+ * to generate its name.
+ * @throws IOException
+ */
+ public static File tempFile(final String prefix, final String suffix) throws IOException {
Review Comment:
This duplicates functionality from TestUtils from client test fixtures. We should get rid of the overload above too.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r2285639977
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/SslManager.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.SslConfigs;
+import org.apache.kafka.common.config.types.Password;
+import org.apache.kafka.common.utils.Utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.KeyPair;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SslManager {
+
+ private static final Logger log = LoggerFactory.getLogger(SslManager.class);
+ private static volatile Map<String, Object> globalSslConfig = null;
Review Comment:
Could its name follow the static variable rules?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3167419903
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
The existing `TestSslUtils` resides in `clients/src/test/java`, so it is only available in the test scope of the clients module. Since `test-common-runtime` is to be used as shared test infrastructure, it cannot depend on the clients test classpath, as that would introduce an invalid dependency.
As a follow-up, we could consider moving common client-side SSL utility methods into test-common,
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3194039687
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/SslManager.java:
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.SslConfigs;
+import org.apache.kafka.common.config.types.Password;
+import org.apache.kafka.common.utils.Utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.KeyPair;
+import java.security.cert.X509Certificate;
+import java.util.List;
+import java.util.Map;
+
+public class SslManager {
+
+ private static final Logger log = LoggerFactory.getLogger(SslManager.class);
+ private final File keyStoreFile;
+ private final File trustStoreFile;
+ public static final String CLUSTER_TRUSTSTORE_PASSWORD = "cluster-truststore-password";
+
+ public SslManager() {
+ try {
+ keyStoreFile = TestUtils.tempFile("kafka.cluster.keystore", ".jks");
+ trustStoreFile = TestUtils.tempFile("kafka.server.truststore", ".jks");
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to create keystore or truststore file", e);
+ }
+ }
+
+ public Map<String, Object> createSslConfig() {
+ try {
+ KeyPair clusterKeyPair = TestSslUtils.generateKeyPair("RSA");
+ String[] hostNames = {"localhost", "127.0.0.1"};
+ X509Certificate clusterCert = TestSslUtils.generateSignedCertificate(
+ "CN=kafka-cluster, O=Kafka Test Cluster",
+ clusterKeyPair,
+ 0,
+ 365,
+ null,
+ null,
+ "SHA256withRSA",
+ false,
+ true,
+ true,
+ hostNames
+ );
+
+ Password keyStorePassword = new Password("cluster-keystore-password");
+ Password keyPassword = new Password("cluster-key-password");
+
+ TestSslUtils.createKeyStore(
+ keyStoreFile.getPath(),
+ keyStorePassword,
+ keyPassword,
+ "kafka-cluster",
+ clusterKeyPair.getPrivate(),
+ clusterCert
+ );
+
+ Password trustStorePassword = new Password(CLUSTER_TRUSTSTORE_PASSWORD);
+ TestSslUtils.createTrustStore(
Review Comment:
@m1a2st TestSslUtils is now available through the clients test fixtures - can we use it in SslManager rather than re-implementing?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3176445238
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
I see. Thank you for your patience helping me understand the issue.
I gave this a try in #22193. PTAL, there's a large surface area for merge conflicts 😅
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3168865265
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
The concern is architectural, adding the clients test output to the `test-common-runtime` main scope would mix test-only code into a shared production classpath. This would cause all modules depending on `test-common-runtime` to transitively pull in clients test classes, which is not appropriate for a shared test infrastructure module.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3173491185
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
I agree with @soarez that duplicating TestSslUtils is ugly and violates DRY. However, since test-common-runtime is meant to be a shared test infrastructure, keeping its dependencies clean and avoiding test-classpath leakage is important for downstream developers.
What if we introduce a new module, like `:test-common:test-common-base`, to house generic, zero-kafka-dependency utilities? We could move the shared SSL utils there now, and it could eventually house other generic tools like wait functions or file-related ops. WDYT?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3609273990
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/ClusterInstance.java:
##########
@@ -150,7 +150,7 @@ default <K, V> Producer<K, V> producer(Map<String, Object> configs) {
props.putIfAbsent(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName());
props.putIfAbsent(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName());
props.putIfAbsent(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers());
- return new KafkaProducer<>(setClientSaslConfig(props));
+ return new KafkaProducer<>(setClientSaslConfig(setClientSslConfig(props)));
Review Comment:
We should have a `createClientSecurityConfig` method to unify `setClientSaslConfig` and `setClientSslConfig`. The call chain is a bit counterintuitive.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3209406407
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/SslManager.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.SslConfigs;
+import org.apache.kafka.common.network.ConnectionMode;
+import org.apache.kafka.common.utils.Utils;
+import org.apache.kafka.test.TestSslUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.Map;
+
+public class SslManager {
+
+ private static final Logger log = LoggerFactory.getLogger(SslManager.class);
+ private File keyStoreFile;
+ private final File trustStoreFile;
+
+ public SslManager() {
+ try {
+ trustStoreFile = org.apache.kafka.test.TestUtils.tempFile("kafka.server.truststore", ".jks");
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to create truststore file", e);
+ }
+ }
+
+ public Map<String, Object> createSslConfig() {
+ try {
+ Map<String, Object> config = new TestSslUtils.SslConfigsBuilder(ConnectionMode.SERVER)
+ .createNewTrustStore(trustStoreFile)
+ .build();
+ keyStoreFile = new File((String) config.get(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG));
+ log.info("Created unified SSL config - KeyStore: {}, TrustStore: {}", keyStoreFile.getPath(), trustStoreFile.getPath());
+ return config;
+ } catch (IOException | GeneralSecurityException e) {
+ throw new RuntimeException("Failed to create SSL config", e);
+ }
+ }
+
+ public String trustStoreLocation() {
+ return trustStoreFile != null ? trustStoreFile.getAbsolutePath() : null;
+ }
Review Comment:
Makes sense, I’ll address it.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on PR #20376:
URL: https://github.com/apache/kafka/pull/20376#issuecomment-4409542547
Thanks for the PR @m1a2st !
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3173119993
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
Thank you @m1a2st.
I want to make sure I understand the concern correctly, because I still can't explain it myself.
My current understanding is that `test-common-runtime` is not actually a production classpath, as its classes are only used for testing.
Looking through `build.gradle`, test classes are already pulled in across modules. e.g. The main classpath for ':jmh-benchmarks' pulls in the test classpath from `:clients`. Another example is `:transaction-coordinator` , whose test classpath pulls in the same dependency.
> This would cause all modules depending on test-common-runtime to transitively pull in clients test classes
They already do - see `core`, `storage`, or `tools` - just declared explicitly rather than transitively. If anything, moving the dependency into test-common-runtime would reduce duplication of declarations across modules.
1. Are these existing examples problematic too, and something we should change?
2. If `test-common-runtime` can include test classes from other modules (e.g. `:test-common:test-common-util`) why does it matter if those classes originate from the main classpath or from another (test) classpath in the dependency module?
3. What specifically makes it inappropriate for modules depending on `test-common-runtime`to also include test classes from `clients`?
It seems important to me to understand this because: introducing competing test kits for SSL cuts against the [current coding guidelines](https://kafka.apache.org/community/developer/#coding-guidelines), and determining if this cross dependency is acceptable seems critical to decide how to address the duplication.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3167281569
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/TestSslUtils.java:
##########
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.types.Password;
+
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.DERT61String;
+import org.bouncycastle.asn1.DERUTF8String;
+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;
+import org.bouncycastle.asn1.x500.RDN;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralNames;
+import org.bouncycastle.asn1.x509.KeyPurposeId;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
+import org.bouncycastle.crypto.util.PrivateKeyFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
+import org.bouncycastle.operator.bc.BcContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcECContentSignerBuilder;
+import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.Map;
+
+public class TestSslUtils {
Review Comment:
Did you consider reusing [TestSslUtils](https://github.com/apache/kafka/blob/4bb8f0fd01e841b775e9037eb5c3960198c89e17/clients/src/test/java/org/apache/kafka/test/TestSslUtils.java) from the `clients` subproject?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3209514241
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/SslManager.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.common.test;
+
+import org.apache.kafka.common.config.SslConfigs;
+import org.apache.kafka.common.network.ConnectionMode;
+import org.apache.kafka.common.utils.Utils;
+import org.apache.kafka.test.TestSslUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.Map;
+
+public class SslManager {
+
+ private static final Logger log = LoggerFactory.getLogger(SslManager.class);
+ private File keyStoreFile;
+ private final File trustStoreFile;
+
+ public SslManager() {
+ try {
+ trustStoreFile = org.apache.kafka.test.TestUtils.tempFile("kafka.server.truststore", ".jks");
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to create truststore file", e);
+ }
+ }
+
+ public Map<String, Object> createSslConfig() {
+ try {
+ Map<String, Object> config = new TestSslUtils.SslConfigsBuilder(ConnectionMode.SERVER)
+ .createNewTrustStore(trustStoreFile)
+ .build();
+ keyStoreFile = new File((String) config.get(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG));
+ log.info("Created unified SSL config - KeyStore: {}, TrustStore: {}", keyStoreFile.getPath(), trustStoreFile.getPath());
+ return config;
+ } catch (IOException | GeneralSecurityException e) {
+ throw new RuntimeException("Failed to create SSL config", e);
+ }
+ }
+
+ public String trustStoreLocation() {
+ return trustStoreFile != null ? trustStoreFile.getAbsolutePath() : null;
+ }
Review Comment:
It seems this `trustStoreLocation` method is no longer used?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on PR #20376:
URL: https://github.com/apache/kafka/pull/20376#issuecomment-4396947691
The Java 25 JUnit check failed 3 tests on the same NPE in ClusterInstance. Filed [KAFKA-20558](https://issues.apache.org/jira/browse/KAFKA-20558) and re-triggered.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18447 Support SASL_SSL protocol with java.security.auth.login.config [kafka]
Posted by "soarez (via GitHub)" <gi...@apache.org>.
soarez commented on code in PR #20376:
URL: https://github.com/apache/kafka/pull/20376#discussion_r3196670122
##########
build.gradle:
##########
@@ -1662,10 +1662,12 @@ project(':test-common:test-common-runtime') {
implementation project(':raft')
implementation project(':storage')
+ implementation libs.bcpkix
Review Comment:
I don't think we need this - it is already included in the clients test fixtures
##########
checkstyle/import-control-test-common-runtime.xml:
##########
@@ -29,4 +29,6 @@
<allow pkg="java" />
<allow pkg="scala.jdk.javaapi" />
<allow pkg="javax.security" />
+ <allow pkg="org.bouncycastle" />
+ <allow pkg="javax.net" />
Review Comment:
Are these still needed?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org