Skip to content

Commit 1d77d6c

Browse files
RebeccaTamachirosdnts
authored andcommitted
[SSL] Use APIRequest component (cloudflare#22474)
* Find occurrences and add placeholder syntax throughout * Fill APIRequest for ciphers calls * Fill in min_tls_version occurrences * Fill values in for aws-alb-integration * Fill in only for first case in origin-configuration/index * Fill in pqc and forward-client-cert partial * Fill in for byo-ca and remove from uploading * Fill in examples in geokey-manager/setup * Adjust related content for custom ciphers via API * Confirm correct cipher strings and remove bash code blocks * Remove remaining bash from custom ciphers api * Double-check and remove original bash throughout
1 parent fb5e220 commit 1d77d6c

File tree

10 files changed

+209
-204
lines changed

10 files changed

+209
-204
lines changed

src/content/docs/ssl/client-certificates/byo-ca.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: Cloudflare mTLS now supports client certificates that have not been
1010

1111
---
1212

13-
import { Render } from "~/components"
13+
import { Render, APIRequest } from "~/components"
1414

1515
This page explains how you can manage mTLS using client certificates that have not been issued by Cloudflare CA.
1616

@@ -95,8 +95,10 @@ If you want to remove a CA that you have previously uploaded, you must first rem
9595

9696
You can also use the [API](/api/resources/certificate_authorities/subresources/hostname_associations/methods/get/) to list the hostname associations. Make sure you include the query parameter `mtls_certificate_id`, where `mtls_certificate_id` is the certificate ID of the uploaded CA (step 2 above).
9797

98-
```bash
99-
curl "https://api.cloudflare.com/client/v4/zones/zone_id/certificate_authorities/hostname_associations?mtls_certificate_id={id_from_step_2}" \
100-
--header "X-Auth-Email: <EMAIL>" \
101-
--header "X-Auth-Key: <API_KEY>"
102-
```
98+
<APIRequest
99+
path="/zones/{zone_id}/certificate_authorities/hostname_associations"
100+
method="GET"
101+
parameters={{
102+
mtls_certificate_id: "ID_FROM_STEP_2"
103+
}}
104+
/>

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

Lines changed: 69 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
label: Use the API
77
---
88

9-
import { Render, TabItem, Tabs } from "~/components";
9+
import { Render, TabItem, Tabs, APIRequest } from "~/components";
1010

1111
<Render file="cipher-suites-definition" />
1212

@@ -25,6 +25,10 @@ Note that:
2525
* If setting up a per-hostname cipher suite customization, make sure that the hostname is specified on the certificate (instead of being covered by a wildcard).
2626
* If you use Windows you might need to adjust the `curl` syntax, refer to [Making API calls on Windows](/fundamentals/api/how-to/make-api-calls/#making-api-calls-on-windows) for further guidance.
2727

28+
:::note
29+
Updating the cipher suites will result in certificates being redeployed.
30+
:::
31+
2832
## Steps and API examples
2933

3034
1. Decide which cipher suites you want to specify and which ones you want to disable (meaning they will not be included in your selection).
@@ -35,82 +39,69 @@ Note that:
3539
3. Get the Zone ID from the [Overview page](https://dash.cloudflare.com/?to=/:account/:zone/) of the domain you want to specify cipher suites for.
3640
4. Make an API call to either the [Edit zone setting](/api/resources/zones/subresources/settings/methods/edit/) endpoint or the [Edit TLS setting for hostname](/api/resources/hostnames/subresources/settings/subresources/tls/methods/update/) endpoint, specifying `ciphers` in the URL. List your array of chosen cipher suites in the `value` field.
3741

38-
:::note
39-
Updating the cipher suites will result in certificates being redeployed.
40-
:::
41-
4242
<Tabs> <TabItem label="modern">
4343

44-
<Render file="ciphers-api-general-notes" />
45-
46-
```bash
47-
# To configure cipher suites per hostname, replace the first two lines by the following
48-
# curl --request PUT \
49-
# "https://api.cloudflare.com/client/v4/zones/{zone_id}/hostnames/settings/ciphers/{hostname}" \
50-
51-
curl --request PATCH \
52-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/ciphers" \
53-
--header "X-Auth-Email: <EMAIL>" \
54-
--header "X-Auth-Key: <API_KEY>" \
55-
--header "Content-Type: application/json" \
56-
--data '{"value": ["ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-CHACHA20-POLY1305", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384"]}'
57-
```
58-
59-
</TabItem> <TabItem label="compatible">
44+
<APIRequest
45+
path="/zones/{zone_id}/settings/{setting_id}"
46+
method="PATCH"
47+
json={{
48+
"value": ["ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-CHACHA20-POLY1305", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384"]
49+
}}
50+
parameters={{
51+
setting_id: "ciphers"
52+
}}
53+
/>
6054

6155
<Render file="ciphers-api-general-notes" />
6256

63-
```bash
64-
# To configure cipher suites per hostname, replace the first two lines by the following
65-
# curl --request PUT \
66-
# "https://api.cloudflare.com/client/v4/zones/{zone_id}/hostnames/settings/ciphers/{hostname}" \
67-
68-
curl --request PATCH \
69-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/ciphers" \
70-
--header "X-Auth-Email: <EMAIL>" \
71-
--header "X-Auth-Key: <API_KEY>" \
72-
--header "Content-Type: application/json" \
73-
--data '{"value": ["ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-CHACHA20-POLY1305", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES128-SHA256", "ECDHE-RSA-AES128-SHA256", "ECDHE-ECDSA-AES256-SHA384", "ECDHE-RSA-AES256-SHA384"]}'
74-
```
57+
</TabItem> <TabItem label="compatible">
7558

76-
</TabItem> <TabItem label="pci dss">
59+
<APIRequest
60+
path="/zones/{zone_id}/settings/{setting_id}"
61+
method="PATCH"
62+
json={{
63+
"value": ["ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-CHACHA20-POLY1305", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES128-SHA256", "ECDHE-RSA-AES128-SHA256", "ECDHE-ECDSA-AES256-SHA384", "ECDHE-RSA-AES256-SHA384"]
64+
}}
65+
parameters={{
66+
setting_id: "ciphers"
67+
}}
68+
/>
7769

7870
<Render file="ciphers-api-general-notes" />
7971

80-
```bash
81-
# To configure cipher suites per hostname, replace the first two lines by the following
82-
# curl --request PUT \
83-
# "https://api.cloudflare.com/client/v4/zones/{zone_id}/hostnames/settings/ciphers/{hostname}" \
84-
85-
curl --request PATCH \
86-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/ciphers" \
87-
--header "X-Auth-Email: <EMAIL>" \
88-
--header "X-Auth-Key: <API_KEY>" \
89-
--header "Content-Type: application/json" \
90-
--data '{"value": ["ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-CHACHA20-POLY1305"]}'
91-
```
92-
93-
:::caution
72+
</TabItem> <TabItem label="pci dss">
9473

74+
:::note
9575
For compliance with PCI DSS, also [enable TLS 1.3](/ssl/edge-certificates/additional-options/tls-13/#enable-tls-13) on your zone and make sure to up your [Minimum TLS version](/ssl/edge-certificates/additional-options/minimum-tls/) to `1.2`.
9676
:::
9777

98-
</TabItem> <TabItem label="fips-140-2">
78+
<APIRequest
79+
path="/zones/{zone_id}/settings/{setting_id}"
80+
method="PATCH"
81+
json={{
82+
"value": ["ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-CHACHA20-POLY1305"]
83+
}}
84+
parameters={{
85+
setting_id: "ciphers"
86+
}}
87+
/>
9988

10089
<Render file="ciphers-api-general-notes" />
10190

102-
```bash
103-
# To configure cipher suites per hostname, replace the first two lines by the following
104-
# curl --request PUT \
105-
# "https://api.cloudflare.com/client/v4/zones/{zone_id}/hostnames/settings/ciphers/{hostname}" \
91+
</TabItem> <TabItem label="fips-140-2">
92+
93+
<APIRequest
94+
path="/zones/{zone_id}/settings/{setting_id}"
95+
method="PATCH"
96+
json={{
97+
"value": ["AES128-GCM-SHA256", "AES128-SHA", "AES128-SHA256", "AES256-SHA", "AES256-SHA256", "DES-CBC3-SHA", "ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-AES128-SHA", "ECDHE-ECDSA-AES128-SHA256", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES256-SHA384", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-AES128-SHA", "ECDHE-RSA-AES128-SHA256", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-SHA", "ECDHE-RSA-AES256-SHA384"]
98+
}}
99+
parameters={{
100+
setting_id: "ciphers"
101+
}}
102+
/>
106103

107-
curl --request PATCH \
108-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/ciphers" \
109-
--header "X-Auth-Email: <EMAIL>" \
110-
--header "X-Auth-Key: <API_KEY>" \
111-
--header "Content-Type: application/json" \
112-
--data '{"value":["AES128-GCM-SHA256", "AES128-SHA", "AES128-SHA256", "AES256-SHA", "AES256-SHA256", "DES-CBC3-SHA", "ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-AES128-SHA", "ECDHE-ECDSA-AES128-SHA256", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES256-SHA384", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-AES128-SHA", "ECDHE-RSA-AES128-SHA256", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-SHA", "ECDHE-RSA-AES256-SHA384"]}'
113-
```
104+
<Render file="ciphers-api-general-notes" />
114105

115106
</TabItem> </Tabs>
116107

@@ -120,26 +111,29 @@ curl --request PATCH \
120111

121112
To reset to the default cipher suites at zone level, use the [Edit zone setting](/api/resources/zones/subresources/settings/methods/edit/) endpoint, specifying `ciphers` as the setting name in the URL, and send an empty array in the `value` field.
122113

123-
```bash
124-
curl --request PATCH \
125-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/ciphers" \
126-
--header "X-Auth-Email: <EMAIL>" \
127-
--header "X-Auth-Key: <API_KEY>" \
128-
--header "Content-Type: application/json" \
129-
--data '{"value": []}'
130-
```
114+
<APIRequest
115+
path="/zones/{zone_id}/settings/{setting_id}"
116+
method="PATCH"
117+
json={{
118+
"value": []
119+
}}
120+
parameters={{
121+
setting_id: "ciphers"
122+
}}
123+
/>
124+
131125

132126
</TabItem> <TabItem label="per-hostname">
133127

134128
For specific hostname settings, use the [Delete TLS setting for hostname](/api/resources/hostnames/subresources/settings/subresources/tls/methods/delete/) endpoint.
135129

136-
```bash
137-
curl --request DELETE \
138-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/hostnames/settings/ciphers/{hostname}" \
139-
--header "X-Auth-Email: <EMAIL>" \
140-
--header "X-Auth-Key: <API_KEY>" \
141-
--header 'Content-Type: application/json' \
142-
```
130+
<APIRequest
131+
path="/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}"
132+
method="DELETE"
133+
parameters={{
134+
setting_id: "ciphers"
135+
}}
136+
/>
143137

144138
</TabItem> </Tabs>
145139

src/content/docs/ssl/edge-certificates/additional-options/minimum-tls.mdx

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 13
66
---
77

8-
import { FeatureTable, TabItem, Tabs } from "~/components";
8+
import { FeatureTable, TabItem, Tabs, APIRequest } from "~/components";
99

1010
Minimum TLS Version only allows HTTPS connections from visitors that support the selected TLS protocol version or newer.
1111

@@ -54,16 +54,17 @@ Use the [Edit zone setting](/api/resources/zones/subresources/settings/methods/e
5454

5555
In the following example, the minimum TLS version for the zone will be set to `1.2`. Replace the zone ID and API token placeholders with your information, and adjust the `value` field with your chosen TLS version.
5656

57-
```bash
58-
curl --request PATCH \
59-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/min_tls_version" \
60-
--header "Authorization: Bearer <API_TOKEN>" \
61-
--header "Content-Type: application/json" \
62-
--data '{
63-
"id": "min_tls_version",
64-
"value": "1.2"
65-
}'
66-
```
57+
<APIRequest
58+
path="/zones/{zone_id}/settings/{setting_id}"
59+
method="PATCH"
60+
json={{
61+
"id": "min_tls_version",
62+
"value": "1.2",
63+
}}
64+
parameters={{
65+
setting_id: "min_tls_version"
66+
}}
67+
/>
6768

6869
</TabItem> </Tabs>
6970

@@ -78,17 +79,18 @@ This is currently only available via the API:
7879

7980
Cloudflare uses the [hostname priority logic](/ssl/reference/certificate-and-hostname-priority/) to determine which setting to apply.
8081

81-
In the following example, the minimum TLS version for a specific hostname will be set to `1.2`. Replace the zone ID, hostname, and API token placeholders with your information, and adjust the `value` field with your chosen TLS version.
82-
83-
```bash
84-
curl --request PUT \
85-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/hostnames/settings/min_tls_version/{hostname}" \
86-
--header "Authorization: Bearer <API_TOKEN>" \
87-
--header "Content-Type: application/json" \
88-
--data '{
89-
"value": "1.2"
90-
}'
91-
```
82+
In the following example, the minimum TLS version for a specific hostname will be set to `1.2`. Replace the zone ID, hostname, and authentication placeholders with your information, and adjust the `value` field with your chosen TLS version.
83+
84+
<APIRequest
85+
path="/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}"
86+
method="PUT"
87+
json={{
88+
"value": "1.2"
89+
}}
90+
parameters={{
91+
setting_id: "min_tls_version"
92+
}}
93+
/>
9294

9395
## Test supported TLS versions
9496

src/content/docs/ssl/edge-certificates/custom-certificates/uploading.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 2
66
---
77

8-
import { Details, GlossaryTooltip, Render, TabItem, Tabs } from "~/components";
8+
import { Details, GlossaryTooltip, Render, TabItem, Tabs, APIRequest } from "~/components";
99

1010
This page lists Cloudflare requirements for custom certificates and explains how to upload and update these certificates using Cloudflare dashboard or API.
1111

@@ -148,7 +148,6 @@ curl https://api.cloudflare.com/client/v4/zones/{zone_id}/custom_certificates \
148148
--header "Content-Type: application/json" \
149149
--data "$request_body"
150150
```
151-
152151
3. (Optional) Add a CAA record.
153152

154153
<Render file="caa-records-definition" />

src/content/docs/ssl/edge-certificates/geokey-manager/setup.mdx

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: Learn how to set up Geo Key Manager and choose the geographical
1010
boundaries of where your private encryption keys are stored.
1111
---
1212

13-
import { Render, TabItem, Tabs, InlineBadge } from "~/components";
13+
import { Render, TabItem, Tabs, InlineBadge, APIRequest, Example } from "~/components";
1414

1515
## Geo Key Manager v2 <InlineBadge preset="beta" />
1616

@@ -36,31 +36,38 @@ You also have access to the `geo_restrictions` parameter, which is mutually excl
3636

3737
### Examples
3838

39-
```bash title="Store private keys in the E.U. and the U.S."
40-
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/custom_certificates" \
41-
--header "X-Auth-Email: <EMAIL>" \
42-
--header "X-Auth-Key: <API_KEY>" \
43-
--header "Content-Type: application/json" \
44-
--data '{
45-
"certificate":"certificate",
46-
"private_key":"<PRIVATE_KEY>",
47-
"policy":"(country: US) and (region: EU)",
48-
"type": "sni_custom"
49-
}'
50-
```
51-
52-
```bash title="Store private keys in the E.U., but not in France"
53-
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/custom_certificates" \
54-
--header "X-Auth-Email: <EMAIL>" \
55-
--header "X-Auth-Key: <API_KEY>" \
56-
--header "Content-Type: application/json" \
57-
--data '{
58-
"certificate":"certificate",
59-
"private_key":"<PRIVATE_KEY>",
60-
"policy":"(region: EU) and (not country: FR)",
61-
"type": "sni_custom"
62-
}'
63-
```
39+
<Example>
40+
41+
Store private keys in the E.U. and the U.S.
42+
43+
<APIRequest
44+
path="/zones/{zone_id}/custom_certificates"
45+
method="POST"
46+
json={{
47+
"certificate":"certificate",
48+
"private_key":"<PRIVATE_KEY>",
49+
"policy":"(country: US) and (region: EU)",
50+
"type": "sni_custom"
51+
}}
52+
/>
53+
54+
</Example>
55+
56+
<Example>
57+
Store private keys in the E.U., but not in France
58+
59+
<APIRequest
60+
path="/zones/{zone_id}/custom_certificates"
61+
method="POST"
62+
json={{
63+
"certificate":"certificate",
64+
"private_key":"<PRIVATE_KEY>",
65+
"policy":"(region: EU) and (not country: FR)",
66+
"type": "sni_custom"
67+
}}
68+
/>
69+
70+
</Example>
6471

6572
:::note
6673

0 commit comments

Comments
 (0)