Skip to content

Commit 2857580

Browse files
committed
Upgrade to MySQL 8.0.
Switch to a newer MySQL version to use TLSv1.2 as newer JRE versions no longer support TLSv1/TLSv1.1. Closes #594.
1 parent 0dc5ccf commit 2857580

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/java/org/springframework/data/r2dbc/testing/MySqlTestSupport.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
import org.testcontainers.containers.MySQLContainer;
3030

31-
import com.github.jasync.r2dbc.mysql.MysqlConnectionFactoryProvider;
3231
import com.mysql.cj.jdbc.MysqlDataSource;
3332

3433
/**
@@ -98,7 +97,7 @@ private static ExternalDatabase local() {
9897
.database("mysql") //
9998
.username("root") //
10099
.password("my-secret-pw") //
101-
.jdbcUrl("jdbc:mysql://localhost:3306/mysql") //
100+
.jdbcUrl("jdbc:mysql://localhost:3306/mysql?allowPublicKeyRetrieval=true") //
102101
.build();
103102
}
104103

@@ -110,7 +109,7 @@ private static ExternalDatabase testContainer() {
110109
if (testContainerDatabase == null) {
111110

112111
try {
113-
MySQLContainer container = new MySQLContainer(MySQLContainer.IMAGE + ":" + MySQLContainer.DEFAULT_TAG);
112+
MySQLContainer container = new MySQLContainer("mysql:8.0.24");
114113
container.start();
115114

116115
testContainerDatabase = ProvidedDatabase.builder(container) //
@@ -153,7 +152,7 @@ public static DataSource createDataSource(ExternalDatabase database) {
153152

154153
dataSource.setUser(database.getUsername());
155154
dataSource.setPassword(database.getPassword());
156-
dataSource.setURL(database.getJdbcUrl() + "?useSSL=false");
155+
dataSource.setURL(database.getJdbcUrl() + "?useSSL=false&allowPublicKeyRetrieval=true");
157156

158157
return dataSource;
159158
}

0 commit comments

Comments
 (0)