# Settings # TLS ## List TLS setting for hostnames `client.Hostnames.Settings.TLS.Get(ctx, settingID, query) (*SinglePage[SettingTLSGetResponse], error)` **get** `/zones/{zone_id}/hostnames/settings/{setting_id}` List the requested TLS setting for the hostnames under this zone. ### Parameters - `settingID SettingTLSGetParamsSettingID` 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"` - `const SettingTLSGetParamsSettingIDCiphers SettingTLSGetParamsSettingID = "ciphers"` - `const SettingTLSGetParamsSettingIDMinTLSVersion SettingTLSGetParamsSettingID = "min_tls_version"` - `const SettingTLSGetParamsSettingIDHTTP2 SettingTLSGetParamsSettingID = "http2"` - `query SettingTLSGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type SettingTLSGetResponse struct{…}` - `CreatedAt Time` 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. - `UpdatedAt Time` This is the time the tls setting was updated. - `Value SettingValueUnion` 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"`) - `type SettingValueString string` - `const SettingValueString1_0 SettingValueString = "1.0"` - `const SettingValueString1_1 SettingValueString = "1.1"` - `const SettingValueString1_2 SettingValueString = "1.2"` - `const SettingValueString1_3 SettingValueString = "1.3"` - `const SettingValueStringOn SettingValueString = "on"` - `const SettingValueStringOff SettingValueString = "off"` - `type SettingValueArray []string` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.Hostnames.Settings.TLS.Get( context.TODO(), hostnames.SettingTLSGetParamsSettingIDCiphers, hostnames.SettingTLSGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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(ctx, settingID, hostname, params) (*Setting, error)` **put** `/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}` Update the tls setting value for the hostname. ### Parameters - `settingID SettingTLSUpdateParamsSettingID` 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"` - `const SettingTLSUpdateParamsSettingIDCiphers SettingTLSUpdateParamsSettingID = "ciphers"` - `const SettingTLSUpdateParamsSettingIDMinTLSVersion SettingTLSUpdateParamsSettingID = "min_tls_version"` - `const SettingTLSUpdateParamsSettingIDHTTP2 SettingTLSUpdateParamsSettingID = "http2"` - `hostname string` The hostname for which the tls settings are set. - `params SettingTLSUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Value param.Field[SettingValueUnion]` 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"`) ### Returns - `type Setting struct{…}` - `CreatedAt Time` 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. - `UpdatedAt Time` This is the time the tls setting was updated. - `Value SettingValueUnion` 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"`) - `type SettingValueString string` - `const SettingValueString1_0 SettingValueString = "1.0"` - `const SettingValueString1_1 SettingValueString = "1.1"` - `const SettingValueString1_2 SettingValueString = "1.2"` - `const SettingValueString1_3 SettingValueString = "1.3"` - `const SettingValueStringOn SettingValueString = "on"` - `const SettingValueStringOff SettingValueString = "off"` - `type SettingValueArray []string` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) setting, err := client.Hostnames.Settings.TLS.Update( context.TODO(), hostnames.SettingTLSUpdateParamsSettingIDCiphers, "app.example.com", hostnames.SettingTLSUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Value: cloudflare.F[hostnames.SettingValueUnionParam](hostnames.SettingValueString(hostnames.SettingValueString1_0)), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", setting.CreatedAt) } ``` #### 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(ctx, settingID, hostname, body) (*SettingTLSDeleteResponse, error)` **delete** `/zones/{zone_id}/hostnames/settings/{setting_id}/{hostname}` Delete the tls setting value for the hostname. ### Parameters - `settingID SettingTLSDeleteParamsSettingID` 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"` - `const SettingTLSDeleteParamsSettingIDCiphers SettingTLSDeleteParamsSettingID = "ciphers"` - `const SettingTLSDeleteParamsSettingIDMinTLSVersion SettingTLSDeleteParamsSettingID = "min_tls_version"` - `const SettingTLSDeleteParamsSettingIDHTTP2 SettingTLSDeleteParamsSettingID = "http2"` - `hostname string` The hostname for which the tls settings are set. - `body SettingTLSDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type SettingTLSDeleteResponse struct{…}` - `CreatedAt Time` 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. - `UpdatedAt Time` This is the time the tls setting was updated. - `Value SettingValueUnion` 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"`) - `type SettingValueString string` - `const SettingValueString1_0 SettingValueString = "1.0"` - `const SettingValueString1_1 SettingValueString = "1.1"` - `const SettingValueString1_2 SettingValueString = "1.2"` - `const SettingValueString1_3 SettingValueString = "1.3"` - `const SettingValueStringOn SettingValueString = "on"` - `const SettingValueStringOff SettingValueString = "off"` - `type SettingValueArray []string` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tls, err := client.Hostnames.Settings.TLS.Delete( context.TODO(), hostnames.SettingTLSDeleteParamsSettingIDCiphers, "app.example.com", hostnames.SettingTLSDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tls.CreatedAt) } ``` #### 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 - `type Setting struct{…}` - `CreatedAt Time` 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. - `UpdatedAt Time` This is the time the tls setting was updated. - `Value SettingValueUnion` 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"`) - `type SettingValueString string` - `const SettingValueString1_0 SettingValueString = "1.0"` - `const SettingValueString1_1 SettingValueString = "1.1"` - `const SettingValueString1_2 SettingValueString = "1.2"` - `const SettingValueString1_3 SettingValueString = "1.3"` - `const SettingValueStringOn SettingValueString = "on"` - `const SettingValueStringOff SettingValueString = "off"` - `type SettingValueArray []string` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings. ### Setting Value - `type SettingValueUnion interface{…}` 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"`) - `type SettingValueString string` - `const SettingValueString1_0 SettingValueString = "1.0"` - `const SettingValueString1_1 SettingValueString = "1.1"` - `const SettingValueString1_2 SettingValueString = "1.2"` - `const SettingValueString1_3 SettingValueString = "1.3"` - `const SettingValueStringOn SettingValueString = "on"` - `const SettingValueStringOff SettingValueString = "off"` - `type SettingValueArray []string` Used when `setting_id` is `ciphers`. An array of allowed cipher suite strings.