Skip to content

Commit d3581f1

Browse files
[CF4SaaS] Add ciphers and MinTLS example API calls (#25151)
* Emphasize linkout to CF4SaaS docs in main ciphers docs and fix typo * Add APIRequest examples under CH custom ciphers instructions * Delete unused partial * Add API steps for minTLS and remove extra <Details> component
1 parent cc1ddf8 commit d3581f1

File tree

3 files changed

+144
-8
lines changed

3 files changed

+144
-8
lines changed

src/content/docs/cloudflare-for-platforms/cloudflare-for-saas/security/certificate-management/enforce-mtls.mdx

Lines changed: 143 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ head:
88
content: TLS Settings — Cloudflare for SaaS
99
---
1010

11-
import { AvailableNotifications, Details, Render, APIRequest } from "~/components";
11+
import { AvailableNotifications, Details, Render, APIRequest, Tabs, TabItem } from "~/components";
1212

1313
[Mutual TLS (mTLS)](https://www.cloudflare.com/learning/access-management/what-is-mutual-tls/) adds an extra layer of protection to application connections by validating certificates on the server and the client. When building a SaaS application, you may want to enforce mTLS to protect sensitive endpoints related to payment processing, database updates, and more.
1414

@@ -42,7 +42,7 @@ Minimum TLS version exists both as a [zone-level setting](/ssl/edge-certificates
4242

4343
- For custom hostnames created via API, it is possible not to explicitly define a value for `min_tls_version`. When that is the case, whatever value is defined as your zone's minimum TLS version will be applied. To confirm whether a given custom hostname has a specific minimum TLS version set, use the following API call.
4444

45-
<Details header="Check custom hostname settings TLS settings">
45+
<Details header="Check custom hostname TLS settings">
4646

4747
<APIRequest
4848
path="/zones/{zone_id}/custom_hostnames/{custom_hostname_id}"
@@ -109,11 +109,86 @@ Refer to [Minimum TLS version - SSL/TLS](/ssl/edge-certificates/additional-optio
109109

110110
<Details header="Minimum TLS version for custom hostname">
111111

112+
<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">
113+
112114
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and website.
113115
2. Go to **SSL/TLS** > **Custom Hostnames**.
114116
3. Find the hostname to which you want to apply Minimum TLS Version. Select **Edit**.
115117
4. Choose the desired TLS version under **Minimum TLS Version** and select **Save**.
116118

119+
</TabItem> <TabItem label="API">
120+
121+
In the API documentation, refer to [SSL properties of a custom hostname](/api/resources/custom_hostnames/methods/edit/). Besides the `settings` specifications, you must include `type` and `method` within the `ssl` object, as explained below.
122+
123+
1. Make a `GET` request to the [Custom Hostname Details](/api/resources/custom_hostnames/methods/get/) endpoint to check what are the current values for `ssl.type` and `ssl.method`.
124+
125+
<APIRequest
126+
path="/zones/{zone_id}/custom_hostnames/{custom_hostname_id}"
127+
method="GET"
128+
/>
129+
130+
```json title="Response example" collapse={5-16, 21-40} ""method": "http"," ""type": "dv","
131+
"success": true,
132+
"result": {
133+
"id": "<CUSTOM_HOSTNAME_ID>",
134+
"ssl": {
135+
"id": "<CERTIFICATE_ID>",
136+
"bundle_method": "ubiquitous",
137+
"certificate_authority": "<CERTIFICATE_AUTHORITY>",
138+
"custom_certificate": "",
139+
"custom_csr_id": "",
140+
"custom_key": "",
141+
"expires_on": "",
142+
"hosts": [
143+
"app.example.com",
144+
"*.app.example.com"
145+
],
146+
"issuer": "",
147+
"method": "http",
148+
"settings": {},
149+
"signature": "SHA256WithRSA",
150+
"type": "dv",
151+
"uploaded_on": "2020-02-06T18:11:23.531995Z",
152+
"validation_errors": [
153+
{
154+
"message": "SERVFAIL looking up CAA for app.example.com"
155+
}
156+
],
157+
"validation_records": [
158+
{
159+
"emails": [
160+
161+
162+
],
163+
"http_body": "ca3-574923932a82475cb8592200f1a2a23d",
164+
"http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
165+
"txt_name": "_acme-challenge.app.example.com",
166+
"txt_value": "810b7d5f01154524b961ba0cd578acc2"
167+
}
168+
],
169+
"wildcard": false
170+
},
171+
}
172+
```
173+
174+
2. After you take note of these values, make a `PATCH` request to the [Edit Custom Hostname](/api/resources/custom_hostnames/methods/edit/) endpoint, providing both the minimum TLS version you want to define and the same `type` and `method` values that you obtained from the previous step.
175+
176+
<APIRequest
177+
path="/zones/{zone_id}/custom_hostnames/{custom_hostname_id}"
178+
method="PATCH"
179+
json={{
180+
ssl: {
181+
method: "http",
182+
type: "dv",
183+
settings: {
184+
"min_tls_version:": "1.2"
185+
}
186+
}
187+
}}
188+
/>
189+
190+
</TabItem> </Tabs>
191+
117192
</Details>
118193

119194
## Cipher suites
@@ -128,12 +203,73 @@ Refer to [Customize cipher suites - SSL/TLS](/ssl/edge-certificates/additional-o
128203

129204
<Details header="Restrict cipher suites for custom hostname">
130205

131-
In the API documentation, refer to [SSL properties of a custom hostname](/api/resources/custom_hostnames/methods/edit/).
206+
In the API documentation, refer to [SSL properties of a custom hostname](/api/resources/custom_hostnames/methods/edit/). Besides the `settings` specifications, you must include `type` and `method` within the `ssl` object, as explained below.
207+
208+
1. Make a `GET` request to the [Custom Hostname Details](/api/resources/custom_hostnames/methods/get/) endpoint to check what are the current values for `ssl.type` and `ssl.method`.
209+
210+
<APIRequest
211+
path="/zones/{zone_id}/custom_hostnames/{custom_hostname_id}"
212+
method="GET"
213+
/>
132214

133-
<Render
134-
file="edit-custom-hostname-api"
135-
params={{ one: "When making the request," }}
136-
product="cloudflare-for-platforms"
215+
```json title="Response example" collapse={5-16, 21-40} ""method": "http"," ""type": "dv","
216+
"success": true,
217+
"result": {
218+
"id": "<CUSTOM_HOSTNAME_ID>",
219+
"ssl": {
220+
"id": "<CERTIFICATE_ID>",
221+
"bundle_method": "ubiquitous",
222+
"certificate_authority": "<CERTIFICATE_AUTHORITY>",
223+
"custom_certificate": "",
224+
"custom_csr_id": "",
225+
"custom_key": "",
226+
"expires_on": "",
227+
"hosts": [
228+
"app.example.com",
229+
"*.app.example.com"
230+
],
231+
"issuer": "",
232+
"method": "http",
233+
"settings": {},
234+
"signature": "SHA256WithRSA",
235+
"type": "dv",
236+
"uploaded_on": "2020-02-06T18:11:23.531995Z",
237+
"validation_errors": [
238+
{
239+
"message": "SERVFAIL looking up CAA for app.example.com"
240+
}
241+
],
242+
"validation_records": [
243+
{
244+
"emails": [
245+
246+
247+
],
248+
"http_body": "ca3-574923932a82475cb8592200f1a2a23d",
249+
"http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
250+
"txt_name": "_acme-challenge.app.example.com",
251+
"txt_value": "810b7d5f01154524b961ba0cd578acc2"
252+
}
253+
],
254+
"wildcard": false
255+
},
256+
}
257+
```
258+
259+
2. After you take note of these values, make a `PATCH` request to the [Edit Custom Hostname](/api/resources/custom_hostnames/methods/edit/) endpoint, providing both the list of authorized cipher suites and the same `type` and `method` values that you obtained from the previous step.
260+
261+
<APIRequest
262+
path="/zones/{zone_id}/custom_hostnames/{custom_hostname_id}"
263+
method="PATCH"
264+
json={{
265+
ssl: {
266+
method: "http",
267+
type: "dv",
268+
settings: {
269+
"ciphers": ["ECDHE-ECDSA-AES128-GCM-SHA256","ECDHE-RSA-AES128-GCM-SHA256"]
270+
}
271+
}
272+
}}
137273
/>
138274

139275
</Details>

src/content/docs/ssl/edge-certificates/additional-options/cipher-suites/customize-cipher-suites/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Currently, you have the following options:
3535

3636
- Set custom cipher suites for a zone: either [via API](/ssl/edge-certificates/additional-options/cipher-suites/customize-cipher-suites/api/) or [on the dashboard](/ssl/edge-certificates/additional-options/cipher-suites/customize-cipher-suites/dashboard/).
3737
- Set custom cipher suites per-hostname: only available [via API](/api/resources/hostnames/subresources/settings/subresources/tls/methods/update/). Refer to the [how-to](/ssl/edge-certificates/additional-options/cipher-suites/customize-cipher-suites/api/) for details.
38+
- <Render file="cipher-suites-saas-linkout" product="ssl" />
3839

3940
:::note
4041
This documentation only refers to connections [between clients and the Cloudflare network](/ssl/concepts/#edge-certificate). For connections between Cloudflare and your origin server, refer to [Origin server > Cipher suites](/ssl/origin-configuration/cipher-suites/).

src/content/partials/cloudflare-for-platforms/edit-custom-hostname-api.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)