Skip to content

Commit 5a7aa4d

Browse files
authored
MINOR: Use SHA256withRSA instead of SHA1withRSA when running SslTransportLayerTest (#20961)
`SHA1withRSA` is disabled in some linux distribution, such as Fedora 43 server, which results in the following error. Hence, this PR adopts the solution suggested by @gaurav-narula in #20561 (comment), which is to use `SHA256withRSA` instead of `SHA1withRSA` ``` Gradle Test Run :clients:test > Gradle Test Executor 28 > Tls13SslFactoryTest > testSslFactoryConfiguration() FAILED org.apache.kafka.common.config.ConfigException: Invalid value javax.net.ssl.SSLHandshakeException: (handshake_failure) No available authentication scheme for configuration A client SSLEngine created with the provided settings can't connect to a server SSLEngine created with those settings. at app//org.apache.kafka.common.security.ssl.SslFactory.configure(SslFactory.java:105) at app//org.apache.kafka.common.security.ssl.SslFactoryTest.testSslFactoryConfiguration(SslFactoryTest.java:80) at [email protected]/java.lang.reflect.Method.invoke(Method.java:580) at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596) at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596) ``` Reviewers: Chia-Ping Tsai <[email protected]>
1 parent 6b035a9 commit 5a7aa4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clients/src/test/java/org/apache/kafka/test/TestSslUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public class TestSslUtils {
111111
* @param dn the X.509 Distinguished Name, eg "CN=Test, L=London, C=GB"
112112
* @param pair the KeyPair
113113
* @param days how many days from now the Certificate is valid for, or - for negative values - how many days before now
114-
* @param algorithm the signing algorithm, eg "SHA1withRSA"
114+
* @param algorithm the signing algorithm, eg "SHA256withRSA"
115115
* @return the self-signed certificate
116116
* @throws CertificateException thrown if a security error or an IO error occurred.
117117
*/
@@ -132,7 +132,7 @@ public static X509Certificate generateCertificate(String dn, KeyPair pair,
132132
* CA.
133133
* @param parentKeyPair The key pair of the issuer. Leave null if you want to generate a root
134134
* CA.
135-
* @param algorithm the signing algorithm, eg "SHA1withRSA"
135+
* @param algorithm the signing algorithm, eg "SHA256withRSA"
136136
* @return the signed certificate
137137
* @throws CertificateException
138138
*/
@@ -399,7 +399,7 @@ public static class CertificateBuilder {
399399
private byte[] subjectAltName;
400400

401401
public CertificateBuilder() {
402-
this(30, "SHA1withRSA");
402+
this(30, "SHA256withRSA");
403403
}
404404

405405
public CertificateBuilder(int days, String algorithm) {

0 commit comments

Comments
 (0)