Skip to content

Commit

Permalink
Fix for Bug#116955 (Bug#37383012), Tests fail after server changed ci…
Browse files Browse the repository at this point in the history
…pher for xdevapi.

Change-Id: Icb84df87ef0189e3f4628e42b4c2d1defdb2b8dd
  • Loading branch information
Axyoan Marcelo committed Dec 11, 2024
1 parent 6303286 commit fb4e090
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 8 additions & 3 deletions src/test/java/testsuite/x/devapi/SecureSessionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -966,15 +966,20 @@ 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";
sess.close();
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());
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit fb4e090

Please sign in to comment.