From fb4e090ffe75b3e0f1728ef4f3faf9cb5aaa8891 Mon Sep 17 00:00:00 2001 From: Axyoan Marcelo Date: Wed, 11 Dec 2024 11:49:02 -0600 Subject: [PATCH] Fix for Bug#116955 (Bug#37383012), Tests fail after server changed cipher for xdevapi. Change-Id: Icb84df87ef0189e3f4628e42b4c2d1defdb2b8dd --- CHANGES | 2 ++ .../java/testsuite/x/devapi/SecureSessionTest.java | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 63f20ea71..18b7e26a7 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ Version 9.2.0 + - Fix for Bug#116955 (Bug#37383012), Tests fail after server changed cipher for xdevapi. + - Fix for Bug#63992 (Bug#14598872), getTables did not return a result for table names with a dot in it. - WL#16558, Upgrade 3rd party libraries and tools. diff --git a/src/test/java/testsuite/x/devapi/SecureSessionTest.java b/src/test/java/testsuite/x/devapi/SecureSessionTest.java index f354b0785..7206d885d 100644 --- a/src/test/java/testsuite/x/devapi/SecureSessionTest.java +++ b/src/test/java/testsuite/x/devapi/SecureSessionTest.java @@ -966,6 +966,7 @@ public void testXdevapiTlsVersionsAndCiphersuites() throws Exception { String testCipher = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"; // TLSv1.2 IANA Cipher name. String expectedCipher = "ECDHE-RSA-AES128-GCM-SHA256"; // TLSv1.2 OpenSSL Cipher name. + String expectedCipher2 = "ECDHE-RSA-AES128-GCM-SHA256"; Session sess = this.fact.getSession(this.baseUrl); String testTlsVersion = getHighestCommonTlsVersion(sess); // At least TLSv1.2 is expected to be supported. String testCipher2 = "DHE-RSA-AES128-GCM-SHA256"; @@ -973,8 +974,12 @@ public void testXdevapiTlsVersionsAndCiphersuites() throws Exception { if ("TLSv1.3".equalsIgnoreCase(testTlsVersion)) { testCipher = "TLS_AES_256_GCM_SHA384"; // TLSv1.3 IANA Cipher name. expectedCipher = "TLS_AES_256_GCM_SHA384"; // TLSv1.3 IANA Cipher name. + expectedCipher2 = "TLS_AES_256_GCM_SHA384"; testCipher2 = "TLS_AES_128_GCM_SHA256"; } + if (mysqlVersionMeetsMinimum(this.baseUrl, ServerVersion.parseVersion("9.2.0"))) { + expectedCipher2 = "TLS_AES_128_GCM_SHA256"; + } Properties props = new Properties(this.sslFreeTestProperties); props.setProperty(PropertyKey.xdevapiSslMode.getKeyName(), PropertyDefinitions.XdevapiSslMode.VERIFY_CA.toString()); @@ -1102,7 +1107,7 @@ public void testXdevapiTlsVersionsAndCiphersuites() throws Exception { // Assess that the connection property is initialized with the correct values and that the correct protocol was used (consult status variable // ssl_cipher for details). testSession = this.fact.getSession(this.sslFreeBaseUrl + makeParam(PropertyKey.xdevapiTlsCiphersuites, testCipher + "," + testCipher2)); - assertSessionStatusEquals(testSession, "mysqlx_ssl_cipher", expectedCipher); + assertSessionStatusEquals(testSession, "mysqlx_ssl_cipher", expectedCipher2); assertTlsVersion(testSession, testTlsVersion); testSession.close(); @@ -1143,7 +1148,7 @@ public void testXdevapiTlsVersionsAndCiphersuites() throws Exception { // ssl_cipher for details). props.setProperty(PropertyKey.xdevapiTlsCiphersuites.getKeyName(), testCipher + "," + testCipher2); testSession = this.fact.getSession(props); - assertSessionStatusEquals(testSession, "mysqlx_ssl_cipher", expectedCipher); + assertSessionStatusEquals(testSession, "mysqlx_ssl_cipher", expectedCipher2); testSession.close(); // TS.FR.4_7. Create an X DevAPI session using a connection properties map containing the connection property xdevapi.tls-versions with a list of valid @@ -1175,7 +1180,7 @@ public void testXdevapiTlsVersionsAndCiphersuites() throws Exception { cli = cf.getClient(this.sslFreeBaseUrl + makeParam(PropertyKey.xdevapiTlsCiphersuites, testCipher + "," + testCipher2), "{\"pooling\": {\"enabled\": true}}"); testSession = cli.getSession(); - assertSessionStatusEquals(testSession, "mysqlx_ssl_cipher", expectedCipher); + assertSessionStatusEquals(testSession, "mysqlx_ssl_cipher", expectedCipher2); assertTlsVersion(testSession, testTlsVersion); testSession.close();