Skip to content

Commit 2eb045c

Browse files
committed
adjust per comments
1 parent 1bb1afc commit 2eb045c

File tree

1 file changed

+56
-7
lines changed

1 file changed

+56
-7
lines changed

src/content/docs/hyperdrive/configuration/tls-ssl-certificates-for-hyperdrive.mdx

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ sidebar:
99

1010
import { TabItem, Tabs, Render, WranglerConfig } from "~/components";
1111

12-
Hyperdrive provides additional ways to secure connectivity to your database. Hyperdrive supports
13-
verification of server certificates for TLS (SSL) encryption for increased security. Hyperdrive also supports
14-
using client certificates to authenticate itself to your database for stricter authentication beyond username/password.
12+
Hyperdrive provides additional ways to secure connectivity to your database. Hyperdrive supports:
13+
14+
1. **Server certificates** for TLS (SSL) modes such as `verify-ca` and `verify-full` for increased security. When configured, Hyperdrive will verify that the certificates have been signed by the expected certificate authority (CA) to avoid man-in-the-middle attacks.
15+
2. **Client certificates** for Hyperdrive to authenticate itself to your database with credentials beyond beyond username/password. To properly use client certificates, your database must be configured to verify the client certificates provided by a client, such as Hyperdrive, to allow access to the database.
16+
17+
Hyperdrive can be configured to use only server certificates, only client certificates, or both depending on your security requirements and database configurations.
1518

1619
:::note
1720

@@ -58,11 +61,31 @@ ID: <YOUR_ID_FOR_THE_CA_CERTIFICATE>
5861
Once your CA certificate has been created, you can create a Hyperdrive configuration with the newly created
5962
certificates using either the dashboard or Wrangler. You must also specify the SSL mode of `verify-ca` or `verify-full` to use.
6063

61-
Using Wrangler, enter the following command in your terminal:
64+
<Tabs>
65+
66+
<TabItem label="Wrangler">
67+
68+
Using Wrangler, enter the following command in your terminal to create a Hyperdrive configuration with the CA certificate and a `verify-full` SSL mode:
6269

6370
```bash
64-
npx wrangler hyperdrive create <NAME_OF_HYPERDRIVE_CONFIG> --connection-string="postgres://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name" --ca-certificate-id <YOUR_CA_CERT_ID> --sslmode verify-full
71+
npx wrangler hyperdrive create <NAME_OF_HYPERDRIVE_CONFIG> --connection-string="postgres://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name" --ca-certificate-id <YOUR_CA_CERT_ID> --sslmode verify-full
6572
```
73+
</TabItem>
74+
75+
<TabItem label="Dashboard">
76+
77+
From the dashboard, follow these steps to create a Hyperdrive configuration with server certificates:
78+
79+
1. In the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/hyperdrive), navigate to **Storage & Databases > Hyperdrive** and click **Create configuration**.
80+
2. Select **Server certificates**.
81+
3. Specify a SSL mode of **Verify CA** or **Verify full**
82+
4. Select the SSL certificate of the certificate authority (CA) of your database that you've previously uploaded with Wrangler.
83+
84+
</TabItem>
85+
86+
</Tabs>
87+
88+
6689

6790
When creating the Hyperdrive configuration, Hyperdrive will attempt to connect to the database with the
6891
provided credentials. If the command provides successful results, you have properly configured your Hyperdrive
@@ -100,12 +123,38 @@ ID: <YOUR_ID_FOR_THE_CLIENT_CERTIFICATE_PAIR>
100123
### Step 2: Create a Hyperdrive configuration
101124

102125
You can now create a Hyperdrive configuration using the newly created client certificate bundle using the dashboard or Wrangler.
103-
Using Wrangler, run the following command:
126+
127+
128+
<Tabs>
129+
130+
<TabItem label="Wrangler">
131+
132+
Using Wrangler, enter the following command in your terminal to create a Hyperdrive configuration with using the client certificate pair:
104133

105134
```bash
106135
npx wrangler hyperdrive create <NAME_OF_HYPERDRIVE_CONFIG> --connection-string="postgres://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name" --mtls-certificate-id <YOUR_CLIENT_CERT_PAIR_ID>
107136
```
137+
</TabItem>
138+
139+
<TabItem label="Dashboard">
140+
141+
From the dashboard, follow these steps to create a Hyperdrive configuration with server certificates:
142+
143+
1. In the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/hyperdrive), navigate to **Storage & Databases > Hyperdrive** and click **Create configuration**.
144+
2. Select **Client certificates**.
145+
3. Select the SSL client certificate and private key pair for Hyperdrive to use during the connection setup with your database server.
146+
147+
</TabItem>
148+
149+
</Tabs>
150+
108151

109152
When Hyperdrive will connect to your database, it will provide a client certificate signed with the private key to the database server. This will allow the database server to confirm that the
110153
client, in this case Hyperdrive, has both the private key and the client certificate. By using client certificates, you can add an additional authentication layer for your database that ensures
111-
that only Hyperdrive can connect to it.
154+
that only Hyperdrive can connect to it.
155+
156+
:::note
157+
158+
Hyperdrive will attempt to connect to your database with the provided credentials to verify they are correct before creating a configuration. If you encounter an error when attempting to connect, refer to Hyperdrive's [troubleshooting documentation](/hyperdrive/observability/troubleshooting/) to debug possible causes.
159+
160+
:::

0 commit comments

Comments
 (0)