Skip to content

Commit 87b3765

Browse files
authored
feat: Automatically set MDX client_protocol_type=TLS for MySQL connections. (#2207)
* feat: Automatically set MDX client_protocol_type=TLS for MySQL connections. When a Cloud SQL instance supports Metadata Exchange, the MySQL socket factory will automatically set MDX client_protocol_type=TLS. This will ensure that the password auth protocol works correctly. See also #2200 and GoogleCloudPlatform/cloud-sql-proxy#2317
1 parent d827c58 commit 87b3765

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ public <T extends Closeable> T connect(
6060
T socket =
6161
(T)
6262
InternalConnectorRegistry.getInstance()
63-
.connect(ConnectionConfig.fromConnectionProperties(props, host));
64-
// TODO: When MDX is fully supported by the server,
65-
// add this configuration to automatically set the client protocol type to TLS.
66-
// .withMdxClientProtocolType("tls"));
63+
.connect(
64+
ConnectionConfig.fromConnectionProperties(props, host)
65+
.withMdxClientProtocolType("tls"));
6766
return socket;
6867
}
6968

0 commit comments

Comments
 (0)