Skip to content

Commit

Permalink
feat: Customer Certificate Authority support
Browse files Browse the repository at this point in the history
  • Loading branch information
hessjcg committed Jan 6, 2025
1 parent f115aa7 commit be451ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (d *Dialer) Dial(ctx context.Context, icn string, opts ...DialOption) (conn
}()

iConn := newInstrumentedConn(tlsConn, func() {
n := atomic.AddUint64(c.openConnsCount, ^uint64(0))
n := atomic.AddUint64(c.openConnsCount, ^uint64(0)) // c.openConnsCount = c.openConnsCount - 1
trace.RecordOpenConnections(context.Background(), int64(n), d.dialerID, cn.String())
}, d.dialerID, cn.String())

Expand Down
3 changes: 2 additions & 1 deletion internal/cloudsql/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ func (c ConnectionInfo) TLSConfig() *tls.Config {
for _, caCert := range c.ServerCACert {
pool.AddCert(caCert)
}
if c.ServerCAMode == "GOOGLE_MANAGED_CAS_CA" {
if c.ServerCAMode == "GOOGLE_MANAGED_CAS_CA" ||
c.ServerCAMode == "CUSTOMER_MANAGED_CAS_CA" {
// For CAS instances, we can rely on the DNS name to verify the server identity.
return &tls.Config{
ServerName: c.DNSName,
Expand Down

0 comments on commit be451ee

Please sign in to comment.