Skip to content

Conversation

@hessjcg
Copy link
Collaborator

@hessjcg hessjcg commented Mar 12, 2025

When the the Cloud SQL Instance reports that it has a DNS Name, the connector will use standard TLS hostname validation when checking the server certificate. Now, the server's TLS certificate must contain a SAN record with the instance's DNS name.

The ConnectSettings API added a field dns_names which contains all of the valid DNS names for
an instance.

See also: GoogleCloudPlatform/cloud-sql-go-connector#954

@hessjcg
Copy link
Collaborator Author

hessjcg commented Mar 12, 2025

The NodeJS SqlAdmin library has not yet been released. This PR will not be ready for review until after the next NodeJS API release.

@hessjcg hessjcg force-pushed the cas-dns-names-field branch 4 times, most recently from e86b449 to 74fc754 Compare March 21, 2025 16:37
@hessjcg hessjcg marked this pull request as ready for review March 21, 2025 16:37
@hessjcg hessjcg requested a review from a team as a code owner March 21, 2025 16:37
@hessjcg hessjcg force-pushed the cas-dns-names-field branch from 74fc754 to bedde48 Compare March 21, 2025 16:40
@hessjcg hessjcg changed the title refactor: Use new ConnectSettings.DnsNames field to validate server TLS certificate feat: Use standard TLS hostname validation for instances with DNS names Mar 21, 2025
// also set the dnsName field.
if (dnsName && pscEnabled) {
ipAddresses.psc = dnsName;
if (pscEnabled) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we still supposed to check for pscEnabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. I think we are checking if pscEnabled but only for the dnsName field.

@hessjcg hessjcg force-pushed the cas-dns-names-field branch from bedde48 to abec09a Compare March 21, 2025 16:47
@hessjcg hessjcg force-pushed the cas-dns-names-field branch from abec09a to 795e092 Compare March 21, 2025 16:53
@hessjcg hessjcg merged commit 15d3bdc into main Mar 21, 2025
28 checks passed
@hessjcg hessjcg deleted the cas-dns-names-field branch March 21, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants