Skip to content

Commit 03f0960

Browse files
committed
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 c2c9ca4 commit 03f0960

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ 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(ConnectionConfig.fromConnectionProperties(props, host)
64+
.withMdxClientProtocolType("tls"));
6765
return socket;
6866
}
6967

0 commit comments

Comments
 (0)