# Hostnames # Settings # TLS ## List TLS setting for hostnames `client.hostnames.settings.tls.get("ciphers" | "min_tls_version" | "http2"settingId, TLSGetParamsparams, RequestOptionsoptions?): SinglePage` **get** `/zones/{zone_id}/hostnames/settings/{setting_id}` List the requested TLS setting for the hostnames under this zone. ### Parameters - `settingId: "ciphers" | "min_tls_version" | "http2"` The TLS Setting name. The value type depends on the setting: - `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`) - `http2`: value is `"on"` or `"off"` - `"ciphers"` - `"min_tls_version"` - `"http2"` - `params: TLSGetParams` - `zone_id: string` Identifier. ### Returns - `TLSGetResponse` - `created_at?: string` This is the time the tls setting was originally created for this hostname. - `hostname?: string` The hostname for which the tls settings are set. - `status?: string` Deployment status for the given tls setting. - `updated_at?: string` This is the time the tls setting was updated. - `value?: SettingValue` The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const tlsGetResponse of client.hostnames.settings.tls.get('ciphers', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(tlsGetResponse.created_at); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "created_at": "2023-07-10T20:01:50.219171Z", "hostname": "app.example.com", "status": "pending_deployment", "updated_at": "2023-07-10T20:01:50.219171Z", "value": "1.0" } ], "result_info": { "count": 1, "page": 1, "per_page": 50, "total_count": 1, "total_pages": 1 } } ``` ## Edit TLS setting for hostname `client.hostnames.settings.tls.update("ciphers" | "min_tls_version" | "http2"settingId, stringhostname, TLSUpdateParamsparams, RequestOptionsoptions?): Setting` **put** `/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}` Update the tls setting value for the hostname. ### Parameters - `settingId: "ciphers" | "min_tls_version" | "http2"` The TLS Setting name. The value type depends on the setting: - `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`) - `http2`: value is `"on"` or `"off"` - `"ciphers"` - `"min_tls_version"` - `"http2"` - `hostname: string` The hostname for which the tls settings are set. - `params: TLSUpdateParams` - `zone_id: string` Path param: Identifier. - `value: SettingValue` Body param: The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array` ### Returns - `Setting` - `created_at?: string` This is the time the tls setting was originally created for this hostname. - `hostname?: string` The hostname for which the tls settings are set. - `status?: string` Deployment status for the given tls setting. - `updated_at?: string` This is the time the tls setting was updated. - `value?: SettingValue` The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const setting = await client.hostnames.settings.tls.update('ciphers', 'app.example.com', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', value: '1.0', }); console.log(setting.created_at); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "created_at": "2023-07-10T20:01:50.219171Z", "hostname": "app.example.com", "status": "pending_deployment", "updated_at": "2023-07-10T20:01:50.219171Z", "value": "1.0" } } ``` ## Delete TLS setting for hostname `client.hostnames.settings.tls.delete("ciphers" | "min_tls_version" | "http2"settingId, stringhostname, TLSDeleteParamsparams, RequestOptionsoptions?): TLSDeleteResponse` **delete** `/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}` Delete the tls setting value for the hostname. ### Parameters - `settingId: "ciphers" | "min_tls_version" | "http2"` The TLS Setting name. The value type depends on the setting: - `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`) - `http2`: value is `"on"` or `"off"` - `"ciphers"` - `"min_tls_version"` - `"http2"` - `hostname: string` The hostname for which the tls settings are set. - `params: TLSDeleteParams` - `zone_id: string` Identifier. ### Returns - `TLSDeleteResponse` - `created_at?: string` This is the time the tls setting was originally created for this hostname. - `hostname?: string` The hostname for which the tls settings are set. - `status?: string` Deployment status for the given tls setting. - `updated_at?: string` This is the time the tls setting was updated. - `value?: SettingValue` The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const tls = await client.hostnames.settings.tls.delete('ciphers', 'app.example.com', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(tls.created_at); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "created_at": "2023-07-10T20:01:50.219171Z", "hostname": "app.example.com", "status": "pending_deployment", "updated_at": "2023-07-10T20:01:50.219171Z", "value": "1.0" } } ``` ## Domain Types ### Setting - `Setting` - `created_at?: string` This is the time the tls setting was originally created for this hostname. - `hostname?: string` The hostname for which the tls settings are set. - `status?: string` Deployment status for the given tls setting. - `updated_at?: string` This is the time the tls setting was updated. - `value?: SettingValue` The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array` ### Setting Value - `SettingValue = "1.0" | "1.1" | "1.2" | 3 more | Array` The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array` ### TLS Get Response - `TLSGetResponse` - `created_at?: string` This is the time the tls setting was originally created for this hostname. - `hostname?: string` The hostname for which the tls settings are set. - `status?: string` Deployment status for the given tls setting. - `updated_at?: string` This is the time the tls setting was updated. - `value?: SettingValue` The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array` ### TLS Delete Response - `TLSDeleteResponse` - `created_at?: string` This is the time the tls setting was originally created for this hostname. - `hostname?: string` The hostname for which the tls settings are set. - `status?: string` Deployment status for the given tls setting. - `updated_at?: string` This is the time the tls setting was updated. - `value?: SettingValue` The TLS setting value. The type depends on the `setting_id` used in the request path: - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) - `min_tls_version`: a string indicating the minimum TLS version — one of `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` (e.g., `"on"`) - `"1.0" | "1.1" | "1.2" | 3 more` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `Array`