> For the complete documentation index, see [llms.txt](https://docs.stacksync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacksync.com/two-way-sync/connectors/postgres/authorize-postgres/cloud-sql/ensuring-secure-cloud-sql-connections-with-ssl-certificate.md).

# Ensuring Secure Cloud SQL Connections with SSL Certificate

Providing the database's SSL certificate when connecting to Cloud SQL is essential to verify the server's identity and prevent man-in-the-middle (MITM) attacks. Without specifying the certificate, the client cannot be sure it is connecting to the intended server, leaving the connection vulnerable to interception by malicious actors. By supplying the SSL certificate, the client can authenticate the server's identity, ensuring that the data exchange happens only with the legitimate database server. This verification step adds a critical layer of trust and security in database connections.

### 1. Identify Your Cloud SQL Instance Configuration

**Access the Google Cloud Console:**

* Log in to the Google Cloud Console and navigate to the **SQL** service
* Select your target database instance from the list

<figure><img src="/files/knzjXmyr14WNX0edY8em" alt=""><figcaption></figcaption></figure>

**Determine Instance Details:**

* Click on the instance name to open the instance details page
* Note your database engine type (PostgreSQL, MySQL, or SQL Server)

<figure><img src="/files/kJO73aEXzp7R47AZhkuB" alt=""><figcaption></figcaption></figure>

### 2. Download the SSL Certificate

**Navigate to Certificate Management:**

* Click on the **Connections** tab
* Click on the **Security** tab
* Locate the **Manage certificates** area

<figure><img src="/files/PuCMjii6vRwxpIdqLlhl" alt=""><figcaption></figcaption></figure>

**Download the Server Certificate:**

* Click **Download Certificates** to get the Certificate Authority (CA) certificate
* The downloaded file will be named `server-ca.pem`
* Save this file securely as you'll need to upload it to Stacksync

<figure><img src="/files/Zz2r2btOGpVxLxCXSxES" alt=""><figcaption></figcaption></figure>

### 3. Upload the SSL Certificate to Stacksync

When creating a new database connection in the Stacksync app, upload the downloaded SSL certificate to complete the secure configuration.

<figure><img src="/files/gZ5rXGKZazsIaCVLgD3B" alt=""><figcaption></figcaption></figure>

***

If you have any questions or need further assistance, reach out to us at <hello@stacksync.com>. We're here to help ensure a seamless and secure database connection setup.
