# Hostnames # Settings # TLS ## List TLS setting for hostnames `hostnames.settings.tls.get(Literal["ciphers", "min_tls_version", "http2"]setting_id, TLSGetParams**kwargs) -> SyncSinglePage[TLSGetResponse]` **get** `/zones/{zone_id}/hostnames/settings/{setting_id}` List the requested TLS setting for the hostnames under this zone. ### Parameters - `zone_id: str` Identifier. - `setting_id: Literal["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"` ### Returns - `class TLSGetResponse: …` - `created_at: Optional[datetime]` This is the time the tls setting was originally created for this hostname. - `hostname: Optional[str]` The hostname for which the tls settings are set. - `status: Optional[str]` Deployment status for the given tls setting. - `updated_at: Optional[datetime]` This is the time the tls setting was updated. - `value: Optional[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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.hostnames.settings.tls.get( setting_id="ciphers", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.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 `hostnames.settings.tls.update(strhostname, TLSUpdateParams**kwargs) -> Setting` **put** `/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}` Update the tls setting value for the hostname. ### Parameters - `zone_id: str` Identifier. - `setting_id: Literal["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: str` The hostname for which the tls settings are set. - `value: SettingValueParam` 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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Returns - `class Setting: …` - `created_at: Optional[datetime]` This is the time the tls setting was originally created for this hostname. - `hostname: Optional[str]` The hostname for which the tls settings are set. - `status: Optional[str]` Deployment status for the given tls setting. - `updated_at: Optional[datetime]` This is the time the tls setting was updated. - `value: Optional[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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) setting = client.hostnames.settings.tls.update( hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", value="1.0", ) print(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 `hostnames.settings.tls.delete(strhostname, TLSDeleteParams**kwargs) -> TLSDeleteResponse` **delete** `/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}` Delete the tls setting value for the hostname. ### Parameters - `zone_id: str` Identifier. - `setting_id: Literal["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: str` The hostname for which the tls settings are set. ### Returns - `class TLSDeleteResponse: …` - `created_at: Optional[datetime]` This is the time the tls setting was originally created for this hostname. - `hostname: Optional[str]` The hostname for which the tls settings are set. - `status: Optional[str]` Deployment status for the given tls setting. - `updated_at: Optional[datetime]` This is the time the tls setting was updated. - `value: Optional[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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) tls = client.hostnames.settings.tls.delete( hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", ) print(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 - `class Setting: …` - `created_at: Optional[datetime]` This is the time the tls setting was originally created for this hostname. - `hostname: Optional[str]` The hostname for which the tls settings are set. - `status: Optional[str]` Deployment status for the given tls setting. - `updated_at: Optional[datetime]` This is the time the tls setting was updated. - `value: Optional[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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Setting Value - `Union[Literal["1.0", "1.1", "1.2", 3 more], List[str]]` 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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### TLS Get Response - `class TLSGetResponse: …` - `created_at: Optional[datetime]` This is the time the tls setting was originally created for this hostname. - `hostname: Optional[str]` The hostname for which the tls settings are set. - `status: Optional[str]` Deployment status for the given tls setting. - `updated_at: Optional[datetime]` This is the time the tls setting was updated. - `value: Optional[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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### TLS Delete Response - `class TLSDeleteResponse: …` - `created_at: Optional[datetime]` This is the time the tls setting was originally created for this hostname. - `hostname: Optional[str]` The hostname for which the tls settings are set. - `status: Optional[str]` Deployment status for the given tls setting. - `updated_at: Optional[datetime]` This is the time the tls setting was updated. - `value: Optional[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"`) - `Literal["1.0", "1.1", "1.2", 3 more]` - `"1.0"` - `"1.1"` - `"1.2"` - `"1.3"` - `"on"` - `"off"` - `List[str]` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings.