Skip to content

Commit

Permalink
fix: deprecate support for MySQL connector/J 5 (#1278)
Browse files Browse the repository at this point in the history
Fixes #1243 

Co-authored-by: Eno Compton <enocom@google.com>
  • Loading branch information
shubha-rajan and enocom authored May 10, 2023
1 parent 3139713 commit 44d6e51
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions jdbc/mysql-j-5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@
SSL certificates manually.
</description>

<distributionManagement>
<relocation>
<groupId>com.google.cloud.sql</groupId>
<artifactId>mysql-socket-factory-connector-j-8</artifactId>
<version>1.11.1-SNAPSHOT</version>
<message>
MySQL Connector/J 5.0.x is no longer under development and has significant security vulnerabilities.
Please update to 8.0.x instead. See the following GitHub issue for more details:
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/1243
</message>
</relocation>
</distributionManagement>

<properties>
<assembly.skipAssembly>false</assembly.skipAssembly>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.IOException;
import java.net.Socket;
import java.util.Properties;
import java.util.logging.Logger;

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

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

0 comments on commit 44d6e51

Please sign in to comment.