Skip to content

Commit 44d6e51

Browse files
shubha-rajanenocom
andauthored
fix: deprecate support for MySQL connector/J 5 (#1278)
Fixes #1243 Co-authored-by: Eno Compton <[email protected]>
1 parent 3139713 commit 44d6e51

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

jdbc/mysql-j-5/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@
3737
SSL certificates manually.
3838
</description>
3939

40+
<distributionManagement>
41+
<relocation>
42+
<groupId>com.google.cloud.sql</groupId>
43+
<artifactId>mysql-socket-factory-connector-j-8</artifactId>
44+
<version>1.11.1-SNAPSHOT</version>
45+
<message>
46+
MySQL Connector/J 5.0.x is no longer under development and has significant security vulnerabilities.
47+
Please update to 8.0.x instead. See the following GitHub issue for more details:
48+
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/1243
49+
</message>
50+
</relocation>
51+
</distributionManagement>
52+
4053
<properties>
4154
<assembly.skipAssembly>false</assembly.skipAssembly>
4255
</properties>

jdbc/mysql-j-5/src/main/java/com/google/cloud/sql/mysql/SocketFactory.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.io.IOException;
2121
import java.net.Socket;
2222
import java.util.Properties;
23+
import java.util.logging.Logger;
2324

2425
/**
2526
* A MySQL {@link SocketFactory} that establishes a secure connection to a Cloud SQL instance using
@@ -37,6 +38,12 @@ public class SocketFactory implements com.mysql.jdbc.SocketFactory {
3738

3839
@Override
3940
public Socket connect(String hostname, int portNumber, Properties props) throws IOException {
41+
Logger logger = Logger.getLogger(SocketFactory.class.getName());
42+
logger.warning(
43+
"MySQL Connector/J 5.0.x is no longer under development"
44+
+ " and has significant security vulnerabilities."
45+
+ " Please update to 8.0.x instead. See the following GitHub issue for more details:"
46+
+ " https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/1243");
4047
try {
4148
socket = CoreSocketFactory.connect(props);
4249
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)