Skip to content

Commit fb2289b

Browse files
[SSL] Add API examples to minimum-tls.mdx (#16707)
* Update minimum-tls.mdx Adding examples to the minimum TLS for zone and hostname API endpoint calls. We still see a lot of customers having trouble with the API syntax to set the minimum TLS version. The idea is to add a clear example to try to reduce the number of requests we get. This way, we can simply point the customers to this document and they can copy and past the syntax on their end. * Small style guide adjustments * Call out the need to replace placeholders and chosen version * Revert double quotes around URL due to weird formatting --------- Co-authored-by: Rebecca Tamachiro <[email protected]>
1 parent 80a81f6 commit fb2289b

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,20 @@ To manage the TLS version applied to your whole zone when proxied through Cloudf
5050

5151
</TabItem> <TabItem label="API">
5252

53-
Use the [Edit zone setting](/api/operations/zone-settings-edit-single-setting) endpoint with `min_tls_version` as the setting name in the URI path, and specify your preferred minimum version in the `value` parameter.
53+
Use the [Edit zone setting](/api/operations/zone-settings-edit-single-setting) endpoint with `min_tls_version` as the setting name in the URI path, and specify your preferred minimum version in the `value` field.
54+
55+
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.
56+
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+
```
5467

5568
</TabItem> </Tabs>
5669

@@ -65,6 +78,18 @@ This is currently only available via the API:
6578

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

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+
```
92+
6893
## Test supported TLS versions
6994

7095
To test supported TLS versions, attempt a request to your website or application while specifying a TLS version.

0 commit comments

Comments
 (0)