Skip to content

Commit e1b9d5a

Browse files
committed
[CONJ-737] sha256User testing correction
1 parent 3d4586a commit e1b9d5a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/test/java/org/mariadb/jdbc/Sha256AuthenticationTest.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,22 @@ public void checkSsl() throws SQLException {
4141
// eat
4242
}
4343

44-
stmt.execute("CREATE USER 'sha256User'@'%'");
45-
stmt.execute(
46-
"GRANT ALL PRIVILEGES ON *.* TO 'sha256User'@'%' IDENTIFIED WITH "
47-
+ "sha256_password BY 'password'");
4844
if (minVersion(8, 0, 0)) {
49-
50-
stmt.execute("CREATE USER 'cachingSha256User'@'%'");
5145
stmt.execute(
52-
"GRANT ALL PRIVILEGES ON *.* TO 'cachingSha256User'@'%' IDENTIFIED WITH "
53-
+ "caching_sha2_password BY 'password'");
46+
"CREATE USER 'sha256User'@'%' IDENTIFIED WITH sha256_password BY 'password'");
47+
stmt.execute(
48+
"GRANT ALL PRIVILEGES ON *.* TO 'sha256User'@'%'");
49+
} else {
50+
stmt.execute("CREATE USER 'sha256User'@'%'");
51+
stmt.execute(
52+
"GRANT ALL PRIVILEGES ON *.* TO 'sha256User'@'%' IDENTIFIED WITH "
53+
+ "sha256_password BY 'password'");
54+
}
55+
if (minVersion(8, 0, 0)) {
56+
stmt.execute(
57+
"CREATE USER 'cachingSha256User'@'%' IDENTIFIED WITH caching_sha2_password BY 'password'");
58+
stmt.execute(
59+
"GRANT ALL PRIVILEGES ON *.* TO 'cachingSha256User'@'%'");
5460
} else {
5561
forceTls = "&enabledSslProtocolSuites=TLSv1.1";
5662
}

0 commit comments

Comments
 (0)