# Custom Hostnames ## List Custom Hostnames `client.CustomHostnames.List(ctx, params) (*V4PagePaginationArray[CustomHostnameListResponse], error)` **get** `/zones/{zone_id}/custom_hostnames` List, search, sort, and filter all of your custom hostnames. ### Parameters - `params CustomHostnameListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `ID param.Field[string]` Query param: Hostname ID to match against. This ID was generated and returned during the initial custom_hostname creation. This parameter cannot be used with the 'hostname' parameter. - `CertificateAuthority param.Field[CustomHostnameListParamsCertificateAuthority]` Query param: Filter by the certificate authority that issued the SSL certificate. - `const CustomHostnameListParamsCertificateAuthorityGoogle CustomHostnameListParamsCertificateAuthority = "google"` - `const CustomHostnameListParamsCertificateAuthorityLetsEncrypt CustomHostnameListParamsCertificateAuthority = "lets_encrypt"` - `const CustomHostnameListParamsCertificateAuthoritySSLCom CustomHostnameListParamsCertificateAuthority = "ssl_com"` - `CustomOriginServer param.Field[string]` Query param: Filter by custom origin server name. - `Direction param.Field[CustomHostnameListParamsDirection]` Query param: Direction to order hostnames. - `const CustomHostnameListParamsDirectionAsc CustomHostnameListParamsDirection = "asc"` - `const CustomHostnameListParamsDirectionDesc CustomHostnameListParamsDirection = "desc"` - `Hostname param.Field[CustomHostnameListParamsHostname]` Query param - `Contain string` Filters hostnames by a substring match on the hostname value. This parameter cannot be used with the 'id' parameter. - `HostnameStatus param.Field[CustomHostnameListParamsHostnameStatus]` Query param: Filter by the hostname's activation status. - `const CustomHostnameListParamsHostnameStatusActive CustomHostnameListParamsHostnameStatus = "active"` - `const CustomHostnameListParamsHostnameStatusPending CustomHostnameListParamsHostnameStatus = "pending"` - `const CustomHostnameListParamsHostnameStatusActiveRedeploying CustomHostnameListParamsHostnameStatus = "active_redeploying"` - `const CustomHostnameListParamsHostnameStatusMoved CustomHostnameListParamsHostnameStatus = "moved"` - `const CustomHostnameListParamsHostnameStatusPendingDeletion CustomHostnameListParamsHostnameStatus = "pending_deletion"` - `const CustomHostnameListParamsHostnameStatusDeleted CustomHostnameListParamsHostnameStatus = "deleted"` - `const CustomHostnameListParamsHostnameStatusPendingBlocked CustomHostnameListParamsHostnameStatus = "pending_blocked"` - `const CustomHostnameListParamsHostnameStatusPendingMigration CustomHostnameListParamsHostnameStatus = "pending_migration"` - `const CustomHostnameListParamsHostnameStatusPendingProvisioned CustomHostnameListParamsHostnameStatus = "pending_provisioned"` - `const CustomHostnameListParamsHostnameStatusTestPending CustomHostnameListParamsHostnameStatus = "test_pending"` - `const CustomHostnameListParamsHostnameStatusTestActive CustomHostnameListParamsHostnameStatus = "test_active"` - `const CustomHostnameListParamsHostnameStatusTestActiveApex CustomHostnameListParamsHostnameStatus = "test_active_apex"` - `const CustomHostnameListParamsHostnameStatusTestBlocked CustomHostnameListParamsHostnameStatus = "test_blocked"` - `const CustomHostnameListParamsHostnameStatusTestFailed CustomHostnameListParamsHostnameStatus = "test_failed"` - `const CustomHostnameListParamsHostnameStatusProvisioned CustomHostnameListParamsHostnameStatus = "provisioned"` - `const CustomHostnameListParamsHostnameStatusBlocked CustomHostnameListParamsHostnameStatus = "blocked"` - `Order param.Field[CustomHostnameListParamsOrder]` Query param: Field to order hostnames by. - `const CustomHostnameListParamsOrderSSL CustomHostnameListParamsOrder = "ssl"` - `const CustomHostnameListParamsOrderSSLStatus CustomHostnameListParamsOrder = "ssl_status"` - `Page param.Field[float64]` Query param: Page number of paginated results. - `PerPage param.Field[float64]` Query param: Number of hostnames per page. - `SSL param.Field[CustomHostnameListParamsSSL]` Query param: Whether to filter hostnames based on if they have SSL enabled. - `const CustomHostnameListParamsSSL0 CustomHostnameListParamsSSL = 0` - `const CustomHostnameListParamsSSL1 CustomHostnameListParamsSSL = 1` - `SSLStatus param.Field[CustomHostnameListParamsSSLStatus]` Query param: Filter by SSL certificate status. - `const CustomHostnameListParamsSSLStatusInitializing CustomHostnameListParamsSSLStatus = "initializing"` - `const CustomHostnameListParamsSSLStatusPendingValidation CustomHostnameListParamsSSLStatus = "pending_validation"` - `const CustomHostnameListParamsSSLStatusDeleted CustomHostnameListParamsSSLStatus = "deleted"` - `const CustomHostnameListParamsSSLStatusPendingIssuance CustomHostnameListParamsSSLStatus = "pending_issuance"` - `const CustomHostnameListParamsSSLStatusPendingDeployment CustomHostnameListParamsSSLStatus = "pending_deployment"` - `const CustomHostnameListParamsSSLStatusPendingDeletion CustomHostnameListParamsSSLStatus = "pending_deletion"` - `const CustomHostnameListParamsSSLStatusPendingExpiration CustomHostnameListParamsSSLStatus = "pending_expiration"` - `const CustomHostnameListParamsSSLStatusExpired CustomHostnameListParamsSSLStatus = "expired"` - `const CustomHostnameListParamsSSLStatusActive CustomHostnameListParamsSSLStatus = "active"` - `const CustomHostnameListParamsSSLStatusInitializingTimedOut CustomHostnameListParamsSSLStatus = "initializing_timed_out"` - `const CustomHostnameListParamsSSLStatusValidationTimedOut CustomHostnameListParamsSSLStatus = "validation_timed_out"` - `const CustomHostnameListParamsSSLStatusIssuanceTimedOut CustomHostnameListParamsSSLStatus = "issuance_timed_out"` - `const CustomHostnameListParamsSSLStatusDeploymentTimedOut CustomHostnameListParamsSSLStatus = "deployment_timed_out"` - `const CustomHostnameListParamsSSLStatusDeletionTimedOut CustomHostnameListParamsSSLStatus = "deletion_timed_out"` - `const CustomHostnameListParamsSSLStatusPendingCleanup CustomHostnameListParamsSSLStatus = "pending_cleanup"` - `const CustomHostnameListParamsSSLStatusStagingDeployment CustomHostnameListParamsSSLStatus = "staging_deployment"` - `const CustomHostnameListParamsSSLStatusStagingActive CustomHostnameListParamsSSLStatus = "staging_active"` - `const CustomHostnameListParamsSSLStatusDeactivating CustomHostnameListParamsSSLStatus = "deactivating"` - `const CustomHostnameListParamsSSLStatusInactive CustomHostnameListParamsSSLStatus = "inactive"` - `const CustomHostnameListParamsSSLStatusBackupIssued CustomHostnameListParamsSSLStatus = "backup_issued"` - `const CustomHostnameListParamsSSLStatusHoldingDeployment CustomHostnameListParamsSSLStatus = "holding_deployment"` - `Wildcard param.Field[bool]` Query param: Filter by whether the custom hostname is a wildcard hostname. ### Returns - `type CustomHostnameListResponse struct{…}` - `ID string` Identifier. - `Hostname string` The custom hostname that will point to your hostname via CNAME. - `CreatedAt Time` This is the time the hostname was created. - `CustomMetadata map[string, string]` Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `CustomOriginServer string` a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record. - `CustomOriginSNI string` A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server. - `OwnershipVerification CustomHostnameListResponseOwnershipVerification` This is a record which can be placed to activate a hostname. - `Name string` DNS Name for record. - `Type CustomHostnameListResponseOwnershipVerificationType` DNS Record type. - `const CustomHostnameListResponseOwnershipVerificationTypeTXT CustomHostnameListResponseOwnershipVerificationType = "txt"` - `Value string` Content for the record. - `OwnershipVerificationHTTP CustomHostnameListResponseOwnershipVerificationHTTP` This presents the token to be served by the given http url to activate a hostname. - `HTTPBody string` Token to be served. - `HTTPURL string` The HTTP URL that will be checked during custom hostname verification and where the customer should host the token. - `SSL CustomHostnameListResponseSSL` - `ID string` Custom hostname SSL identifier tag. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `DCVDelegationRecords []CustomHostnameListResponseSsldcvDelegationRecord` DCV Delegation records for domain validation. - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `ExpiresOn Time` The time the custom certificate expires on. - `Hosts []string` A list of Hostnames on a custom uploaded certificate. - `Issuer string` The issuer on a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `SerialNumber string` The serial number on a custom uploaded certificate. - `Settings CustomHostnameListResponseSSLSettings` - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CustomHostnameListResponseSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CustomHostnameListResponseSSLSettingsEarlyHintsOn CustomHostnameListResponseSSLSettingsEarlyHints = "on"` - `const CustomHostnameListResponseSSLSettingsEarlyHintsOff CustomHostnameListResponseSSLSettingsEarlyHints = "off"` - `HTTP2 CustomHostnameListResponseSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CustomHostnameListResponseSSLSettingsHTTP2On CustomHostnameListResponseSSLSettingsHTTP2 = "on"` - `const CustomHostnameListResponseSSLSettingsHTTP2Off CustomHostnameListResponseSSLSettingsHTTP2 = "off"` - `MinTLSVersion CustomHostnameListResponseSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CustomHostnameListResponseSSLSettingsMinTLSVersion1_0 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.0"` - `const CustomHostnameListResponseSSLSettingsMinTLSVersion1_1 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.1"` - `const CustomHostnameListResponseSSLSettingsMinTLSVersion1_2 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.2"` - `const CustomHostnameListResponseSSLSettingsMinTLSVersion1_3 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CustomHostnameListResponseSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CustomHostnameListResponseSSLSettingsTLS1_3On CustomHostnameListResponseSSLSettingsTLS1_3 = "on"` - `const CustomHostnameListResponseSSLSettingsTLS1_3Off CustomHostnameListResponseSSLSettingsTLS1_3 = "off"` - `Signature string` The signature on a custom uploaded certificate. - `Status CustomHostnameListResponseSSLStatus` Status of the hostname's SSL certificates. - `const CustomHostnameListResponseSSLStatusInitializing CustomHostnameListResponseSSLStatus = "initializing"` - `const CustomHostnameListResponseSSLStatusPendingValidation CustomHostnameListResponseSSLStatus = "pending_validation"` - `const CustomHostnameListResponseSSLStatusDeleted CustomHostnameListResponseSSLStatus = "deleted"` - `const CustomHostnameListResponseSSLStatusPendingIssuance CustomHostnameListResponseSSLStatus = "pending_issuance"` - `const CustomHostnameListResponseSSLStatusPendingDeployment CustomHostnameListResponseSSLStatus = "pending_deployment"` - `const CustomHostnameListResponseSSLStatusPendingDeletion CustomHostnameListResponseSSLStatus = "pending_deletion"` - `const CustomHostnameListResponseSSLStatusPendingExpiration CustomHostnameListResponseSSLStatus = "pending_expiration"` - `const CustomHostnameListResponseSSLStatusExpired CustomHostnameListResponseSSLStatus = "expired"` - `const CustomHostnameListResponseSSLStatusActive CustomHostnameListResponseSSLStatus = "active"` - `const CustomHostnameListResponseSSLStatusInitializingTimedOut CustomHostnameListResponseSSLStatus = "initializing_timed_out"` - `const CustomHostnameListResponseSSLStatusValidationTimedOut CustomHostnameListResponseSSLStatus = "validation_timed_out"` - `const CustomHostnameListResponseSSLStatusIssuanceTimedOut CustomHostnameListResponseSSLStatus = "issuance_timed_out"` - `const CustomHostnameListResponseSSLStatusDeploymentTimedOut CustomHostnameListResponseSSLStatus = "deployment_timed_out"` - `const CustomHostnameListResponseSSLStatusDeletionTimedOut CustomHostnameListResponseSSLStatus = "deletion_timed_out"` - `const CustomHostnameListResponseSSLStatusPendingCleanup CustomHostnameListResponseSSLStatus = "pending_cleanup"` - `const CustomHostnameListResponseSSLStatusStagingDeployment CustomHostnameListResponseSSLStatus = "staging_deployment"` - `const CustomHostnameListResponseSSLStatusStagingActive CustomHostnameListResponseSSLStatus = "staging_active"` - `const CustomHostnameListResponseSSLStatusDeactivating CustomHostnameListResponseSSLStatus = "deactivating"` - `const CustomHostnameListResponseSSLStatusInactive CustomHostnameListResponseSSLStatus = "inactive"` - `const CustomHostnameListResponseSSLStatusBackupIssued CustomHostnameListResponseSSLStatus = "backup_issued"` - `const CustomHostnameListResponseSSLStatusHoldingDeployment CustomHostnameListResponseSSLStatus = "holding_deployment"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `UploadedOn Time` The time the custom certificate was uploaded. - `ValidationErrors []CustomHostnameListResponseSSLValidationError` Domain validation errors that have been received by the certificate authority (CA). - `Message string` A domain validation error. - `ValidationRecords []CustomHostnameListResponseSSLValidationRecord` - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `Wildcard bool` Indicates whether the certificate covers a wildcard. - `Status CustomHostnameListResponseStatus` Status of the hostname's activation. - `const CustomHostnameListResponseStatusActive CustomHostnameListResponseStatus = "active"` - `const CustomHostnameListResponseStatusPending CustomHostnameListResponseStatus = "pending"` - `const CustomHostnameListResponseStatusActiveRedeploying CustomHostnameListResponseStatus = "active_redeploying"` - `const CustomHostnameListResponseStatusMoved CustomHostnameListResponseStatus = "moved"` - `const CustomHostnameListResponseStatusPendingDeletion CustomHostnameListResponseStatus = "pending_deletion"` - `const CustomHostnameListResponseStatusDeleted CustomHostnameListResponseStatus = "deleted"` - `const CustomHostnameListResponseStatusPendingBlocked CustomHostnameListResponseStatus = "pending_blocked"` - `const CustomHostnameListResponseStatusPendingMigration CustomHostnameListResponseStatus = "pending_migration"` - `const CustomHostnameListResponseStatusPendingProvisioned CustomHostnameListResponseStatus = "pending_provisioned"` - `const CustomHostnameListResponseStatusTestPending CustomHostnameListResponseStatus = "test_pending"` - `const CustomHostnameListResponseStatusTestActive CustomHostnameListResponseStatus = "test_active"` - `const CustomHostnameListResponseStatusTestActiveApex CustomHostnameListResponseStatus = "test_active_apex"` - `const CustomHostnameListResponseStatusTestBlocked CustomHostnameListResponseStatus = "test_blocked"` - `const CustomHostnameListResponseStatusTestFailed CustomHostnameListResponseStatus = "test_failed"` - `const CustomHostnameListResponseStatusProvisioned CustomHostnameListResponseStatus = "provisioned"` - `const CustomHostnameListResponseStatusBlocked CustomHostnameListResponseStatus = "blocked"` - `VerificationErrors []string` These are errors that were encountered while trying to activate a hostname. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.CustomHostnames.List(context.TODO(), custom_hostnames.CustomHostnameListParams{ 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": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "hostname": "app.example.com", "created_at": "2020-02-06T18:11:23.531995Z", "custom_metadata": { "foo": "string" }, "custom_origin_server": "origin2.example.com", "custom_origin_sni": "sni.example.com", "ownership_verification": { "name": "_cf-custom-hostname.app.example.com", "type": "txt", "value": "5cc07c04-ea62-4a5a-95f0-419334a875a4" }, "ownership_verification_http": { "http_body": "5cc07c04-ea62-4a5a-95f0-419334a875a4", "http_url": "http://custom.test.com/.well-known/cf-custom-hostname-challenge/0d89c70d-ad9f-4843-b99f-6cc0252067e9" }, "ssl": { "id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9", "bundle_method": "ubiquitous", "certificate_authority": "google", "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "dcv_delegation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "expires_on": "2021-02-06T18:11:23.531995Z", "hosts": [ "app.example.com", "*.app.example.com" ], "issuer": "DigiCertInc", "method": "http", "serial_number": "6743787633689793699141714808227354901", "settings": { "ciphers": [ "ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA" ], "early_hints": "on", "http2": "on", "min_tls_version": "1.2", "tls_1_3": "on" }, "signature": "SHA256WithRSA", "status": "pending_validation", "type": "dv", "uploaded_on": "2020-02-06T18:11:23.531995Z", "validation_errors": [ { "message": "SERVFAIL looking up CAA for app.example.com" } ], "validation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "wildcard": false }, "status": "pending", "verification_errors": [ "None of the A or AAAA records are owned by this account and the pre-generated ownership verification token was not found." ] } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Custom Hostname Details `client.CustomHostnames.Get(ctx, customHostnameID, query) (*CustomHostnameGetResponse, error)` **get** `/zones/{zone_id}/custom_hostnames/{custom_hostname_id}` Retrieves detailed information about a specific custom hostname, including SSL certificate status, ownership verification, and origin configuration. ### Parameters - `customHostnameID string` Identifier. - `query CustomHostnameGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type CustomHostnameGetResponse struct{…}` - `ID string` Identifier. - `Hostname string` The custom hostname that will point to your hostname via CNAME. - `CreatedAt Time` This is the time the hostname was created. - `CustomMetadata map[string, string]` Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `CustomOriginServer string` a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record. - `CustomOriginSNI string` A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server. - `OwnershipVerification CustomHostnameGetResponseOwnershipVerification` This is a record which can be placed to activate a hostname. - `Name string` DNS Name for record. - `Type CustomHostnameGetResponseOwnershipVerificationType` DNS Record type. - `const CustomHostnameGetResponseOwnershipVerificationTypeTXT CustomHostnameGetResponseOwnershipVerificationType = "txt"` - `Value string` Content for the record. - `OwnershipVerificationHTTP CustomHostnameGetResponseOwnershipVerificationHTTP` This presents the token to be served by the given http url to activate a hostname. - `HTTPBody string` Token to be served. - `HTTPURL string` The HTTP URL that will be checked during custom hostname verification and where the customer should host the token. - `SSL CustomHostnameGetResponseSSL` - `ID string` Custom hostname SSL identifier tag. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `DCVDelegationRecords []CustomHostnameGetResponseSsldcvDelegationRecord` DCV Delegation records for domain validation. - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `ExpiresOn Time` The time the custom certificate expires on. - `Hosts []string` A list of Hostnames on a custom uploaded certificate. - `Issuer string` The issuer on a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `SerialNumber string` The serial number on a custom uploaded certificate. - `Settings CustomHostnameGetResponseSSLSettings` - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CustomHostnameGetResponseSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CustomHostnameGetResponseSSLSettingsEarlyHintsOn CustomHostnameGetResponseSSLSettingsEarlyHints = "on"` - `const CustomHostnameGetResponseSSLSettingsEarlyHintsOff CustomHostnameGetResponseSSLSettingsEarlyHints = "off"` - `HTTP2 CustomHostnameGetResponseSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CustomHostnameGetResponseSSLSettingsHTTP2On CustomHostnameGetResponseSSLSettingsHTTP2 = "on"` - `const CustomHostnameGetResponseSSLSettingsHTTP2Off CustomHostnameGetResponseSSLSettingsHTTP2 = "off"` - `MinTLSVersion CustomHostnameGetResponseSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CustomHostnameGetResponseSSLSettingsMinTLSVersion1_0 CustomHostnameGetResponseSSLSettingsMinTLSVersion = "1.0"` - `const CustomHostnameGetResponseSSLSettingsMinTLSVersion1_1 CustomHostnameGetResponseSSLSettingsMinTLSVersion = "1.1"` - `const CustomHostnameGetResponseSSLSettingsMinTLSVersion1_2 CustomHostnameGetResponseSSLSettingsMinTLSVersion = "1.2"` - `const CustomHostnameGetResponseSSLSettingsMinTLSVersion1_3 CustomHostnameGetResponseSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CustomHostnameGetResponseSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CustomHostnameGetResponseSSLSettingsTLS1_3On CustomHostnameGetResponseSSLSettingsTLS1_3 = "on"` - `const CustomHostnameGetResponseSSLSettingsTLS1_3Off CustomHostnameGetResponseSSLSettingsTLS1_3 = "off"` - `Signature string` The signature on a custom uploaded certificate. - `Status CustomHostnameGetResponseSSLStatus` Status of the hostname's SSL certificates. - `const CustomHostnameGetResponseSSLStatusInitializing CustomHostnameGetResponseSSLStatus = "initializing"` - `const CustomHostnameGetResponseSSLStatusPendingValidation CustomHostnameGetResponseSSLStatus = "pending_validation"` - `const CustomHostnameGetResponseSSLStatusDeleted CustomHostnameGetResponseSSLStatus = "deleted"` - `const CustomHostnameGetResponseSSLStatusPendingIssuance CustomHostnameGetResponseSSLStatus = "pending_issuance"` - `const CustomHostnameGetResponseSSLStatusPendingDeployment CustomHostnameGetResponseSSLStatus = "pending_deployment"` - `const CustomHostnameGetResponseSSLStatusPendingDeletion CustomHostnameGetResponseSSLStatus = "pending_deletion"` - `const CustomHostnameGetResponseSSLStatusPendingExpiration CustomHostnameGetResponseSSLStatus = "pending_expiration"` - `const CustomHostnameGetResponseSSLStatusExpired CustomHostnameGetResponseSSLStatus = "expired"` - `const CustomHostnameGetResponseSSLStatusActive CustomHostnameGetResponseSSLStatus = "active"` - `const CustomHostnameGetResponseSSLStatusInitializingTimedOut CustomHostnameGetResponseSSLStatus = "initializing_timed_out"` - `const CustomHostnameGetResponseSSLStatusValidationTimedOut CustomHostnameGetResponseSSLStatus = "validation_timed_out"` - `const CustomHostnameGetResponseSSLStatusIssuanceTimedOut CustomHostnameGetResponseSSLStatus = "issuance_timed_out"` - `const CustomHostnameGetResponseSSLStatusDeploymentTimedOut CustomHostnameGetResponseSSLStatus = "deployment_timed_out"` - `const CustomHostnameGetResponseSSLStatusDeletionTimedOut CustomHostnameGetResponseSSLStatus = "deletion_timed_out"` - `const CustomHostnameGetResponseSSLStatusPendingCleanup CustomHostnameGetResponseSSLStatus = "pending_cleanup"` - `const CustomHostnameGetResponseSSLStatusStagingDeployment CustomHostnameGetResponseSSLStatus = "staging_deployment"` - `const CustomHostnameGetResponseSSLStatusStagingActive CustomHostnameGetResponseSSLStatus = "staging_active"` - `const CustomHostnameGetResponseSSLStatusDeactivating CustomHostnameGetResponseSSLStatus = "deactivating"` - `const CustomHostnameGetResponseSSLStatusInactive CustomHostnameGetResponseSSLStatus = "inactive"` - `const CustomHostnameGetResponseSSLStatusBackupIssued CustomHostnameGetResponseSSLStatus = "backup_issued"` - `const CustomHostnameGetResponseSSLStatusHoldingDeployment CustomHostnameGetResponseSSLStatus = "holding_deployment"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `UploadedOn Time` The time the custom certificate was uploaded. - `ValidationErrors []CustomHostnameGetResponseSSLValidationError` Domain validation errors that have been received by the certificate authority (CA). - `Message string` A domain validation error. - `ValidationRecords []CustomHostnameGetResponseSSLValidationRecord` - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `Wildcard bool` Indicates whether the certificate covers a wildcard. - `Status CustomHostnameGetResponseStatus` Status of the hostname's activation. - `const CustomHostnameGetResponseStatusActive CustomHostnameGetResponseStatus = "active"` - `const CustomHostnameGetResponseStatusPending CustomHostnameGetResponseStatus = "pending"` - `const CustomHostnameGetResponseStatusActiveRedeploying CustomHostnameGetResponseStatus = "active_redeploying"` - `const CustomHostnameGetResponseStatusMoved CustomHostnameGetResponseStatus = "moved"` - `const CustomHostnameGetResponseStatusPendingDeletion CustomHostnameGetResponseStatus = "pending_deletion"` - `const CustomHostnameGetResponseStatusDeleted CustomHostnameGetResponseStatus = "deleted"` - `const CustomHostnameGetResponseStatusPendingBlocked CustomHostnameGetResponseStatus = "pending_blocked"` - `const CustomHostnameGetResponseStatusPendingMigration CustomHostnameGetResponseStatus = "pending_migration"` - `const CustomHostnameGetResponseStatusPendingProvisioned CustomHostnameGetResponseStatus = "pending_provisioned"` - `const CustomHostnameGetResponseStatusTestPending CustomHostnameGetResponseStatus = "test_pending"` - `const CustomHostnameGetResponseStatusTestActive CustomHostnameGetResponseStatus = "test_active"` - `const CustomHostnameGetResponseStatusTestActiveApex CustomHostnameGetResponseStatus = "test_active_apex"` - `const CustomHostnameGetResponseStatusTestBlocked CustomHostnameGetResponseStatus = "test_blocked"` - `const CustomHostnameGetResponseStatusTestFailed CustomHostnameGetResponseStatus = "test_failed"` - `const CustomHostnameGetResponseStatusProvisioned CustomHostnameGetResponseStatus = "provisioned"` - `const CustomHostnameGetResponseStatusBlocked CustomHostnameGetResponseStatus = "blocked"` - `VerificationErrors []string` These are errors that were encountered while trying to activate a hostname. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) customHostname, err := client.CustomHostnames.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", custom_hostnames.CustomHostnameGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customHostname.ID) } ``` #### 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": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "hostname": "app.example.com", "created_at": "2020-02-06T18:11:23.531995Z", "custom_metadata": { "foo": "string" }, "custom_origin_server": "origin2.example.com", "custom_origin_sni": "sni.example.com", "ownership_verification": { "name": "_cf-custom-hostname.app.example.com", "type": "txt", "value": "5cc07c04-ea62-4a5a-95f0-419334a875a4" }, "ownership_verification_http": { "http_body": "5cc07c04-ea62-4a5a-95f0-419334a875a4", "http_url": "http://custom.test.com/.well-known/cf-custom-hostname-challenge/0d89c70d-ad9f-4843-b99f-6cc0252067e9" }, "ssl": { "id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9", "bundle_method": "ubiquitous", "certificate_authority": "google", "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "dcv_delegation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "expires_on": "2021-02-06T18:11:23.531995Z", "hosts": [ "app.example.com", "*.app.example.com" ], "issuer": "DigiCertInc", "method": "http", "serial_number": "6743787633689793699141714808227354901", "settings": { "ciphers": [ "ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA" ], "early_hints": "on", "http2": "on", "min_tls_version": "1.2", "tls_1_3": "on" }, "signature": "SHA256WithRSA", "status": "pending_validation", "type": "dv", "uploaded_on": "2020-02-06T18:11:23.531995Z", "validation_errors": [ { "message": "SERVFAIL looking up CAA for app.example.com" } ], "validation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "wildcard": false }, "status": "pending", "verification_errors": [ "None of the A or AAAA records are owned by this account and the pre-generated ownership verification token was not found." ] } } ``` ## Create Custom Hostname `client.CustomHostnames.New(ctx, params) (*CustomHostnameNewResponse, error)` **post** `/zones/{zone_id}/custom_hostnames` Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' recommended if the CNAME is already in place (or will be soon). Specifying 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH method must be used once it is (to complete validation). Enable bundling of certificates using the custom_cert_bundle field. The bundling process requires the following condition One certificate in the bundle must use an RSA, and the other must use an ECDSA. ### Parameters - `params CustomHostnameNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Hostname param.Field[string]` Body param: The custom hostname that will point to your hostname via CNAME. - `CustomMetadata param.Field[map[string, string]]` Body param: Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `SSL param.Field[CustomHostnameNewParamsSSL]` Body param: SSL properties used when creating the custom hostname. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CloudflareBranding bool` Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true - `CustomCERTBundle []CustomHostnameNewParamsSSLCustomCERTBundle` Array of custom certificate and key pairs (1 or 2 pairs allowed) - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomKey string` The key for a custom uploaded certificate. - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `Settings CustomHostnameNewParamsSSLSettings` SSL specific settings. - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CustomHostnameNewParamsSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CustomHostnameNewParamsSSLSettingsEarlyHintsOn CustomHostnameNewParamsSSLSettingsEarlyHints = "on"` - `const CustomHostnameNewParamsSSLSettingsEarlyHintsOff CustomHostnameNewParamsSSLSettingsEarlyHints = "off"` - `HTTP2 CustomHostnameNewParamsSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CustomHostnameNewParamsSSLSettingsHTTP2On CustomHostnameNewParamsSSLSettingsHTTP2 = "on"` - `const CustomHostnameNewParamsSSLSettingsHTTP2Off CustomHostnameNewParamsSSLSettingsHTTP2 = "off"` - `MinTLSVersion CustomHostnameNewParamsSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CustomHostnameNewParamsSSLSettingsMinTLSVersion1_0 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.0"` - `const CustomHostnameNewParamsSSLSettingsMinTLSVersion1_1 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.1"` - `const CustomHostnameNewParamsSSLSettingsMinTLSVersion1_2 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.2"` - `const CustomHostnameNewParamsSSLSettingsMinTLSVersion1_3 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CustomHostnameNewParamsSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CustomHostnameNewParamsSSLSettingsTLS1_3On CustomHostnameNewParamsSSLSettingsTLS1_3 = "on"` - `const CustomHostnameNewParamsSSLSettingsTLS1_3Off CustomHostnameNewParamsSSLSettingsTLS1_3 = "off"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `Wildcard bool` Indicates whether the certificate covers a wildcard. ### Returns - `type CustomHostnameNewResponse struct{…}` - `ID string` Identifier. - `Hostname string` The custom hostname that will point to your hostname via CNAME. - `CreatedAt Time` This is the time the hostname was created. - `CustomMetadata map[string, string]` Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `CustomOriginServer string` a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record. - `CustomOriginSNI string` A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server. - `OwnershipVerification CustomHostnameNewResponseOwnershipVerification` This is a record which can be placed to activate a hostname. - `Name string` DNS Name for record. - `Type CustomHostnameNewResponseOwnershipVerificationType` DNS Record type. - `const CustomHostnameNewResponseOwnershipVerificationTypeTXT CustomHostnameNewResponseOwnershipVerificationType = "txt"` - `Value string` Content for the record. - `OwnershipVerificationHTTP CustomHostnameNewResponseOwnershipVerificationHTTP` This presents the token to be served by the given http url to activate a hostname. - `HTTPBody string` Token to be served. - `HTTPURL string` The HTTP URL that will be checked during custom hostname verification and where the customer should host the token. - `SSL CustomHostnameNewResponseSSL` - `ID string` Custom hostname SSL identifier tag. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `DCVDelegationRecords []CustomHostnameNewResponseSsldcvDelegationRecord` DCV Delegation records for domain validation. - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `ExpiresOn Time` The time the custom certificate expires on. - `Hosts []string` A list of Hostnames on a custom uploaded certificate. - `Issuer string` The issuer on a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `SerialNumber string` The serial number on a custom uploaded certificate. - `Settings CustomHostnameNewResponseSSLSettings` - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CustomHostnameNewResponseSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CustomHostnameNewResponseSSLSettingsEarlyHintsOn CustomHostnameNewResponseSSLSettingsEarlyHints = "on"` - `const CustomHostnameNewResponseSSLSettingsEarlyHintsOff CustomHostnameNewResponseSSLSettingsEarlyHints = "off"` - `HTTP2 CustomHostnameNewResponseSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CustomHostnameNewResponseSSLSettingsHTTP2On CustomHostnameNewResponseSSLSettingsHTTP2 = "on"` - `const CustomHostnameNewResponseSSLSettingsHTTP2Off CustomHostnameNewResponseSSLSettingsHTTP2 = "off"` - `MinTLSVersion CustomHostnameNewResponseSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CustomHostnameNewResponseSSLSettingsMinTLSVersion1_0 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.0"` - `const CustomHostnameNewResponseSSLSettingsMinTLSVersion1_1 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.1"` - `const CustomHostnameNewResponseSSLSettingsMinTLSVersion1_2 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.2"` - `const CustomHostnameNewResponseSSLSettingsMinTLSVersion1_3 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CustomHostnameNewResponseSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CustomHostnameNewResponseSSLSettingsTLS1_3On CustomHostnameNewResponseSSLSettingsTLS1_3 = "on"` - `const CustomHostnameNewResponseSSLSettingsTLS1_3Off CustomHostnameNewResponseSSLSettingsTLS1_3 = "off"` - `Signature string` The signature on a custom uploaded certificate. - `Status CustomHostnameNewResponseSSLStatus` Status of the hostname's SSL certificates. - `const CustomHostnameNewResponseSSLStatusInitializing CustomHostnameNewResponseSSLStatus = "initializing"` - `const CustomHostnameNewResponseSSLStatusPendingValidation CustomHostnameNewResponseSSLStatus = "pending_validation"` - `const CustomHostnameNewResponseSSLStatusDeleted CustomHostnameNewResponseSSLStatus = "deleted"` - `const CustomHostnameNewResponseSSLStatusPendingIssuance CustomHostnameNewResponseSSLStatus = "pending_issuance"` - `const CustomHostnameNewResponseSSLStatusPendingDeployment CustomHostnameNewResponseSSLStatus = "pending_deployment"` - `const CustomHostnameNewResponseSSLStatusPendingDeletion CustomHostnameNewResponseSSLStatus = "pending_deletion"` - `const CustomHostnameNewResponseSSLStatusPendingExpiration CustomHostnameNewResponseSSLStatus = "pending_expiration"` - `const CustomHostnameNewResponseSSLStatusExpired CustomHostnameNewResponseSSLStatus = "expired"` - `const CustomHostnameNewResponseSSLStatusActive CustomHostnameNewResponseSSLStatus = "active"` - `const CustomHostnameNewResponseSSLStatusInitializingTimedOut CustomHostnameNewResponseSSLStatus = "initializing_timed_out"` - `const CustomHostnameNewResponseSSLStatusValidationTimedOut CustomHostnameNewResponseSSLStatus = "validation_timed_out"` - `const CustomHostnameNewResponseSSLStatusIssuanceTimedOut CustomHostnameNewResponseSSLStatus = "issuance_timed_out"` - `const CustomHostnameNewResponseSSLStatusDeploymentTimedOut CustomHostnameNewResponseSSLStatus = "deployment_timed_out"` - `const CustomHostnameNewResponseSSLStatusDeletionTimedOut CustomHostnameNewResponseSSLStatus = "deletion_timed_out"` - `const CustomHostnameNewResponseSSLStatusPendingCleanup CustomHostnameNewResponseSSLStatus = "pending_cleanup"` - `const CustomHostnameNewResponseSSLStatusStagingDeployment CustomHostnameNewResponseSSLStatus = "staging_deployment"` - `const CustomHostnameNewResponseSSLStatusStagingActive CustomHostnameNewResponseSSLStatus = "staging_active"` - `const CustomHostnameNewResponseSSLStatusDeactivating CustomHostnameNewResponseSSLStatus = "deactivating"` - `const CustomHostnameNewResponseSSLStatusInactive CustomHostnameNewResponseSSLStatus = "inactive"` - `const CustomHostnameNewResponseSSLStatusBackupIssued CustomHostnameNewResponseSSLStatus = "backup_issued"` - `const CustomHostnameNewResponseSSLStatusHoldingDeployment CustomHostnameNewResponseSSLStatus = "holding_deployment"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `UploadedOn Time` The time the custom certificate was uploaded. - `ValidationErrors []CustomHostnameNewResponseSSLValidationError` Domain validation errors that have been received by the certificate authority (CA). - `Message string` A domain validation error. - `ValidationRecords []CustomHostnameNewResponseSSLValidationRecord` - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `Wildcard bool` Indicates whether the certificate covers a wildcard. - `Status CustomHostnameNewResponseStatus` Status of the hostname's activation. - `const CustomHostnameNewResponseStatusActive CustomHostnameNewResponseStatus = "active"` - `const CustomHostnameNewResponseStatusPending CustomHostnameNewResponseStatus = "pending"` - `const CustomHostnameNewResponseStatusActiveRedeploying CustomHostnameNewResponseStatus = "active_redeploying"` - `const CustomHostnameNewResponseStatusMoved CustomHostnameNewResponseStatus = "moved"` - `const CustomHostnameNewResponseStatusPendingDeletion CustomHostnameNewResponseStatus = "pending_deletion"` - `const CustomHostnameNewResponseStatusDeleted CustomHostnameNewResponseStatus = "deleted"` - `const CustomHostnameNewResponseStatusPendingBlocked CustomHostnameNewResponseStatus = "pending_blocked"` - `const CustomHostnameNewResponseStatusPendingMigration CustomHostnameNewResponseStatus = "pending_migration"` - `const CustomHostnameNewResponseStatusPendingProvisioned CustomHostnameNewResponseStatus = "pending_provisioned"` - `const CustomHostnameNewResponseStatusTestPending CustomHostnameNewResponseStatus = "test_pending"` - `const CustomHostnameNewResponseStatusTestActive CustomHostnameNewResponseStatus = "test_active"` - `const CustomHostnameNewResponseStatusTestActiveApex CustomHostnameNewResponseStatus = "test_active_apex"` - `const CustomHostnameNewResponseStatusTestBlocked CustomHostnameNewResponseStatus = "test_blocked"` - `const CustomHostnameNewResponseStatusTestFailed CustomHostnameNewResponseStatus = "test_failed"` - `const CustomHostnameNewResponseStatusProvisioned CustomHostnameNewResponseStatus = "provisioned"` - `const CustomHostnameNewResponseStatusBlocked CustomHostnameNewResponseStatus = "blocked"` - `VerificationErrors []string` These are errors that were encountered while trying to activate a hostname. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) customHostname, err := client.CustomHostnames.New(context.TODO(), custom_hostnames.CustomHostnameNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Hostname: cloudflare.F("app.example.com"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customHostname.ID) } ``` #### 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": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "hostname": "app.example.com", "created_at": "2020-02-06T18:11:23.531995Z", "custom_metadata": { "foo": "string" }, "custom_origin_server": "origin2.example.com", "custom_origin_sni": "sni.example.com", "ownership_verification": { "name": "_cf-custom-hostname.app.example.com", "type": "txt", "value": "5cc07c04-ea62-4a5a-95f0-419334a875a4" }, "ownership_verification_http": { "http_body": "5cc07c04-ea62-4a5a-95f0-419334a875a4", "http_url": "http://custom.test.com/.well-known/cf-custom-hostname-challenge/0d89c70d-ad9f-4843-b99f-6cc0252067e9" }, "ssl": { "id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9", "bundle_method": "ubiquitous", "certificate_authority": "google", "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "dcv_delegation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "expires_on": "2021-02-06T18:11:23.531995Z", "hosts": [ "app.example.com", "*.app.example.com" ], "issuer": "DigiCertInc", "method": "http", "serial_number": "6743787633689793699141714808227354901", "settings": { "ciphers": [ "ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA" ], "early_hints": "on", "http2": "on", "min_tls_version": "1.2", "tls_1_3": "on" }, "signature": "SHA256WithRSA", "status": "pending_validation", "type": "dv", "uploaded_on": "2020-02-06T18:11:23.531995Z", "validation_errors": [ { "message": "SERVFAIL looking up CAA for app.example.com" } ], "validation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "wildcard": false }, "status": "pending", "verification_errors": [ "None of the A or AAAA records are owned by this account and the pre-generated ownership verification token was not found." ] } } ``` ## Edit Custom Hostname `client.CustomHostnames.Edit(ctx, customHostnameID, params) (*CustomHostnameEditResponse, error)` **patch** `/zones/{zone_id}/custom_hostnames/{custom_hostname_id}` Modify SSL configuration for a custom hostname. When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from 'http' to 'email'. Bundle an existing certificate with another certificate by using the "custom_cert_bundle" field. The bundling process supports combining certificates as long as the following condition is met. One certificate must use the RSA algorithm, and the other must use the ECDSA algorithm. ### Parameters - `customHostnameID string` Identifier. - `params CustomHostnameEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `CustomMetadata param.Field[map[string, string]]` Body param: Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `CustomOriginServer param.Field[string]` Body param: a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record. - `CustomOriginSNI param.Field[string]` Body param: A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server. - `SSL param.Field[CustomHostnameEditParamsSSL]` Body param: SSL properties used when creating the custom hostname. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CloudflareBranding bool` Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true - `CustomCERTBundle []CustomHostnameEditParamsSSLCustomCERTBundle` Array of custom certificate and key pairs (1 or 2 pairs allowed) - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomKey string` The key for a custom uploaded certificate. - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `Settings CustomHostnameEditParamsSSLSettings` SSL specific settings. - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CustomHostnameEditParamsSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CustomHostnameEditParamsSSLSettingsEarlyHintsOn CustomHostnameEditParamsSSLSettingsEarlyHints = "on"` - `const CustomHostnameEditParamsSSLSettingsEarlyHintsOff CustomHostnameEditParamsSSLSettingsEarlyHints = "off"` - `HTTP2 CustomHostnameEditParamsSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CustomHostnameEditParamsSSLSettingsHTTP2On CustomHostnameEditParamsSSLSettingsHTTP2 = "on"` - `const CustomHostnameEditParamsSSLSettingsHTTP2Off CustomHostnameEditParamsSSLSettingsHTTP2 = "off"` - `MinTLSVersion CustomHostnameEditParamsSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CustomHostnameEditParamsSSLSettingsMinTLSVersion1_0 CustomHostnameEditParamsSSLSettingsMinTLSVersion = "1.0"` - `const CustomHostnameEditParamsSSLSettingsMinTLSVersion1_1 CustomHostnameEditParamsSSLSettingsMinTLSVersion = "1.1"` - `const CustomHostnameEditParamsSSLSettingsMinTLSVersion1_2 CustomHostnameEditParamsSSLSettingsMinTLSVersion = "1.2"` - `const CustomHostnameEditParamsSSLSettingsMinTLSVersion1_3 CustomHostnameEditParamsSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CustomHostnameEditParamsSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CustomHostnameEditParamsSSLSettingsTLS1_3On CustomHostnameEditParamsSSLSettingsTLS1_3 = "on"` - `const CustomHostnameEditParamsSSLSettingsTLS1_3Off CustomHostnameEditParamsSSLSettingsTLS1_3 = "off"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `Wildcard bool` Indicates whether the certificate covers a wildcard. ### Returns - `type CustomHostnameEditResponse struct{…}` - `ID string` Identifier. - `Hostname string` The custom hostname that will point to your hostname via CNAME. - `CreatedAt Time` This is the time the hostname was created. - `CustomMetadata map[string, string]` Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `CustomOriginServer string` a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record. - `CustomOriginSNI string` A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server. - `OwnershipVerification CustomHostnameEditResponseOwnershipVerification` This is a record which can be placed to activate a hostname. - `Name string` DNS Name for record. - `Type CustomHostnameEditResponseOwnershipVerificationType` DNS Record type. - `const CustomHostnameEditResponseOwnershipVerificationTypeTXT CustomHostnameEditResponseOwnershipVerificationType = "txt"` - `Value string` Content for the record. - `OwnershipVerificationHTTP CustomHostnameEditResponseOwnershipVerificationHTTP` This presents the token to be served by the given http url to activate a hostname. - `HTTPBody string` Token to be served. - `HTTPURL string` The HTTP URL that will be checked during custom hostname verification and where the customer should host the token. - `SSL CustomHostnameEditResponseSSL` - `ID string` Custom hostname SSL identifier tag. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `DCVDelegationRecords []CustomHostnameEditResponseSsldcvDelegationRecord` DCV Delegation records for domain validation. - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `ExpiresOn Time` The time the custom certificate expires on. - `Hosts []string` A list of Hostnames on a custom uploaded certificate. - `Issuer string` The issuer on a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `SerialNumber string` The serial number on a custom uploaded certificate. - `Settings CustomHostnameEditResponseSSLSettings` - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CustomHostnameEditResponseSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CustomHostnameEditResponseSSLSettingsEarlyHintsOn CustomHostnameEditResponseSSLSettingsEarlyHints = "on"` - `const CustomHostnameEditResponseSSLSettingsEarlyHintsOff CustomHostnameEditResponseSSLSettingsEarlyHints = "off"` - `HTTP2 CustomHostnameEditResponseSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CustomHostnameEditResponseSSLSettingsHTTP2On CustomHostnameEditResponseSSLSettingsHTTP2 = "on"` - `const CustomHostnameEditResponseSSLSettingsHTTP2Off CustomHostnameEditResponseSSLSettingsHTTP2 = "off"` - `MinTLSVersion CustomHostnameEditResponseSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CustomHostnameEditResponseSSLSettingsMinTLSVersion1_0 CustomHostnameEditResponseSSLSettingsMinTLSVersion = "1.0"` - `const CustomHostnameEditResponseSSLSettingsMinTLSVersion1_1 CustomHostnameEditResponseSSLSettingsMinTLSVersion = "1.1"` - `const CustomHostnameEditResponseSSLSettingsMinTLSVersion1_2 CustomHostnameEditResponseSSLSettingsMinTLSVersion = "1.2"` - `const CustomHostnameEditResponseSSLSettingsMinTLSVersion1_3 CustomHostnameEditResponseSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CustomHostnameEditResponseSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CustomHostnameEditResponseSSLSettingsTLS1_3On CustomHostnameEditResponseSSLSettingsTLS1_3 = "on"` - `const CustomHostnameEditResponseSSLSettingsTLS1_3Off CustomHostnameEditResponseSSLSettingsTLS1_3 = "off"` - `Signature string` The signature on a custom uploaded certificate. - `Status CustomHostnameEditResponseSSLStatus` Status of the hostname's SSL certificates. - `const CustomHostnameEditResponseSSLStatusInitializing CustomHostnameEditResponseSSLStatus = "initializing"` - `const CustomHostnameEditResponseSSLStatusPendingValidation CustomHostnameEditResponseSSLStatus = "pending_validation"` - `const CustomHostnameEditResponseSSLStatusDeleted CustomHostnameEditResponseSSLStatus = "deleted"` - `const CustomHostnameEditResponseSSLStatusPendingIssuance CustomHostnameEditResponseSSLStatus = "pending_issuance"` - `const CustomHostnameEditResponseSSLStatusPendingDeployment CustomHostnameEditResponseSSLStatus = "pending_deployment"` - `const CustomHostnameEditResponseSSLStatusPendingDeletion CustomHostnameEditResponseSSLStatus = "pending_deletion"` - `const CustomHostnameEditResponseSSLStatusPendingExpiration CustomHostnameEditResponseSSLStatus = "pending_expiration"` - `const CustomHostnameEditResponseSSLStatusExpired CustomHostnameEditResponseSSLStatus = "expired"` - `const CustomHostnameEditResponseSSLStatusActive CustomHostnameEditResponseSSLStatus = "active"` - `const CustomHostnameEditResponseSSLStatusInitializingTimedOut CustomHostnameEditResponseSSLStatus = "initializing_timed_out"` - `const CustomHostnameEditResponseSSLStatusValidationTimedOut CustomHostnameEditResponseSSLStatus = "validation_timed_out"` - `const CustomHostnameEditResponseSSLStatusIssuanceTimedOut CustomHostnameEditResponseSSLStatus = "issuance_timed_out"` - `const CustomHostnameEditResponseSSLStatusDeploymentTimedOut CustomHostnameEditResponseSSLStatus = "deployment_timed_out"` - `const CustomHostnameEditResponseSSLStatusDeletionTimedOut CustomHostnameEditResponseSSLStatus = "deletion_timed_out"` - `const CustomHostnameEditResponseSSLStatusPendingCleanup CustomHostnameEditResponseSSLStatus = "pending_cleanup"` - `const CustomHostnameEditResponseSSLStatusStagingDeployment CustomHostnameEditResponseSSLStatus = "staging_deployment"` - `const CustomHostnameEditResponseSSLStatusStagingActive CustomHostnameEditResponseSSLStatus = "staging_active"` - `const CustomHostnameEditResponseSSLStatusDeactivating CustomHostnameEditResponseSSLStatus = "deactivating"` - `const CustomHostnameEditResponseSSLStatusInactive CustomHostnameEditResponseSSLStatus = "inactive"` - `const CustomHostnameEditResponseSSLStatusBackupIssued CustomHostnameEditResponseSSLStatus = "backup_issued"` - `const CustomHostnameEditResponseSSLStatusHoldingDeployment CustomHostnameEditResponseSSLStatus = "holding_deployment"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `UploadedOn Time` The time the custom certificate was uploaded. - `ValidationErrors []CustomHostnameEditResponseSSLValidationError` Domain validation errors that have been received by the certificate authority (CA). - `Message string` A domain validation error. - `ValidationRecords []CustomHostnameEditResponseSSLValidationRecord` - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `Wildcard bool` Indicates whether the certificate covers a wildcard. - `Status CustomHostnameEditResponseStatus` Status of the hostname's activation. - `const CustomHostnameEditResponseStatusActive CustomHostnameEditResponseStatus = "active"` - `const CustomHostnameEditResponseStatusPending CustomHostnameEditResponseStatus = "pending"` - `const CustomHostnameEditResponseStatusActiveRedeploying CustomHostnameEditResponseStatus = "active_redeploying"` - `const CustomHostnameEditResponseStatusMoved CustomHostnameEditResponseStatus = "moved"` - `const CustomHostnameEditResponseStatusPendingDeletion CustomHostnameEditResponseStatus = "pending_deletion"` - `const CustomHostnameEditResponseStatusDeleted CustomHostnameEditResponseStatus = "deleted"` - `const CustomHostnameEditResponseStatusPendingBlocked CustomHostnameEditResponseStatus = "pending_blocked"` - `const CustomHostnameEditResponseStatusPendingMigration CustomHostnameEditResponseStatus = "pending_migration"` - `const CustomHostnameEditResponseStatusPendingProvisioned CustomHostnameEditResponseStatus = "pending_provisioned"` - `const CustomHostnameEditResponseStatusTestPending CustomHostnameEditResponseStatus = "test_pending"` - `const CustomHostnameEditResponseStatusTestActive CustomHostnameEditResponseStatus = "test_active"` - `const CustomHostnameEditResponseStatusTestActiveApex CustomHostnameEditResponseStatus = "test_active_apex"` - `const CustomHostnameEditResponseStatusTestBlocked CustomHostnameEditResponseStatus = "test_blocked"` - `const CustomHostnameEditResponseStatusTestFailed CustomHostnameEditResponseStatus = "test_failed"` - `const CustomHostnameEditResponseStatusProvisioned CustomHostnameEditResponseStatus = "provisioned"` - `const CustomHostnameEditResponseStatusBlocked CustomHostnameEditResponseStatus = "blocked"` - `VerificationErrors []string` These are errors that were encountered while trying to activate a hostname. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.CustomHostnames.Edit( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", custom_hostnames.CustomHostnameEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### 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": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "hostname": "app.example.com", "created_at": "2020-02-06T18:11:23.531995Z", "custom_metadata": { "foo": "string" }, "custom_origin_server": "origin2.example.com", "custom_origin_sni": "sni.example.com", "ownership_verification": { "name": "_cf-custom-hostname.app.example.com", "type": "txt", "value": "5cc07c04-ea62-4a5a-95f0-419334a875a4" }, "ownership_verification_http": { "http_body": "5cc07c04-ea62-4a5a-95f0-419334a875a4", "http_url": "http://custom.test.com/.well-known/cf-custom-hostname-challenge/0d89c70d-ad9f-4843-b99f-6cc0252067e9" }, "ssl": { "id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9", "bundle_method": "ubiquitous", "certificate_authority": "google", "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "dcv_delegation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "expires_on": "2021-02-06T18:11:23.531995Z", "hosts": [ "app.example.com", "*.app.example.com" ], "issuer": "DigiCertInc", "method": "http", "serial_number": "6743787633689793699141714808227354901", "settings": { "ciphers": [ "ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA" ], "early_hints": "on", "http2": "on", "min_tls_version": "1.2", "tls_1_3": "on" }, "signature": "SHA256WithRSA", "status": "pending_validation", "type": "dv", "uploaded_on": "2020-02-06T18:11:23.531995Z", "validation_errors": [ { "message": "SERVFAIL looking up CAA for app.example.com" } ], "validation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "wildcard": false }, "status": "pending", "verification_errors": [ "None of the A or AAAA records are owned by this account and the pre-generated ownership verification token was not found." ] } } ``` ## Delete Custom Hostname (and any issued SSL certificates) `client.CustomHostnames.Delete(ctx, customHostnameID, body) (*CustomHostnameDeleteResponse, error)` **delete** `/zones/{zone_id}/custom_hostnames/{custom_hostname_id}` Permanently deletes a custom hostname and revokes any SSL certificates that were issued for it. This action cannot be undone. ### Parameters - `customHostnameID string` Identifier. - `body CustomHostnameDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type CustomHostnameDeleteResponse struct{…}` - `ID string` Identifier. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) customHostname, err := client.CustomHostnames.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", custom_hostnames.CustomHostnameDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customHostname.ID) } ``` #### Response ```json { "id": "023e105f4ecef8ad9ca31a8372d0c353" } ``` ## Domain Types ### Bundle Method - `type BundleMethod string` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` ### Custom Hostname - `type CustomHostname struct{…}` - `ID string` Identifier. - `Hostname string` The custom hostname that will point to your hostname via CNAME. - `CreatedAt Time` This is the time the hostname was created. - `CustomMetadata map[string, string]` Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `CustomOriginServer string` a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record. - `CustomOriginSNI string` A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server. - `OwnershipVerification CustomHostnameOwnershipVerification` This is a record which can be placed to activate a hostname. - `Name string` DNS Name for record. - `Type CustomHostnameOwnershipVerificationType` DNS Record type. - `const CustomHostnameOwnershipVerificationTypeTXT CustomHostnameOwnershipVerificationType = "txt"` - `Value string` Content for the record. - `OwnershipVerificationHTTP CustomHostnameOwnershipVerificationHTTP` This presents the token to be served by the given http url to activate a hostname. - `HTTPBody string` Token to be served. - `HTTPURL string` The HTTP URL that will be checked during custom hostname verification and where the customer should host the token. - `SSL CustomHostnameSSL` - `ID string` Custom hostname SSL identifier tag. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `DCVDelegationRecords []CustomHostnameSsldcvDelegationRecord` DCV Delegation records for domain validation. - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `ExpiresOn Time` The time the custom certificate expires on. - `Hosts []string` A list of Hostnames on a custom uploaded certificate. - `Issuer string` The issuer on a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `SerialNumber string` The serial number on a custom uploaded certificate. - `Settings CustomHostnameSSLSettings` - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CustomHostnameSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CustomHostnameSSLSettingsEarlyHintsOn CustomHostnameSSLSettingsEarlyHints = "on"` - `const CustomHostnameSSLSettingsEarlyHintsOff CustomHostnameSSLSettingsEarlyHints = "off"` - `HTTP2 CustomHostnameSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CustomHostnameSSLSettingsHTTP2On CustomHostnameSSLSettingsHTTP2 = "on"` - `const CustomHostnameSSLSettingsHTTP2Off CustomHostnameSSLSettingsHTTP2 = "off"` - `MinTLSVersion CustomHostnameSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CustomHostnameSSLSettingsMinTLSVersion1_0 CustomHostnameSSLSettingsMinTLSVersion = "1.0"` - `const CustomHostnameSSLSettingsMinTLSVersion1_1 CustomHostnameSSLSettingsMinTLSVersion = "1.1"` - `const CustomHostnameSSLSettingsMinTLSVersion1_2 CustomHostnameSSLSettingsMinTLSVersion = "1.2"` - `const CustomHostnameSSLSettingsMinTLSVersion1_3 CustomHostnameSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CustomHostnameSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CustomHostnameSSLSettingsTLS1_3On CustomHostnameSSLSettingsTLS1_3 = "on"` - `const CustomHostnameSSLSettingsTLS1_3Off CustomHostnameSSLSettingsTLS1_3 = "off"` - `Signature string` The signature on a custom uploaded certificate. - `Status CustomHostnameSSLStatus` Status of the hostname's SSL certificates. - `const CustomHostnameSSLStatusInitializing CustomHostnameSSLStatus = "initializing"` - `const CustomHostnameSSLStatusPendingValidation CustomHostnameSSLStatus = "pending_validation"` - `const CustomHostnameSSLStatusDeleted CustomHostnameSSLStatus = "deleted"` - `const CustomHostnameSSLStatusPendingIssuance CustomHostnameSSLStatus = "pending_issuance"` - `const CustomHostnameSSLStatusPendingDeployment CustomHostnameSSLStatus = "pending_deployment"` - `const CustomHostnameSSLStatusPendingDeletion CustomHostnameSSLStatus = "pending_deletion"` - `const CustomHostnameSSLStatusPendingExpiration CustomHostnameSSLStatus = "pending_expiration"` - `const CustomHostnameSSLStatusExpired CustomHostnameSSLStatus = "expired"` - `const CustomHostnameSSLStatusActive CustomHostnameSSLStatus = "active"` - `const CustomHostnameSSLStatusInitializingTimedOut CustomHostnameSSLStatus = "initializing_timed_out"` - `const CustomHostnameSSLStatusValidationTimedOut CustomHostnameSSLStatus = "validation_timed_out"` - `const CustomHostnameSSLStatusIssuanceTimedOut CustomHostnameSSLStatus = "issuance_timed_out"` - `const CustomHostnameSSLStatusDeploymentTimedOut CustomHostnameSSLStatus = "deployment_timed_out"` - `const CustomHostnameSSLStatusDeletionTimedOut CustomHostnameSSLStatus = "deletion_timed_out"` - `const CustomHostnameSSLStatusPendingCleanup CustomHostnameSSLStatus = "pending_cleanup"` - `const CustomHostnameSSLStatusStagingDeployment CustomHostnameSSLStatus = "staging_deployment"` - `const CustomHostnameSSLStatusStagingActive CustomHostnameSSLStatus = "staging_active"` - `const CustomHostnameSSLStatusDeactivating CustomHostnameSSLStatus = "deactivating"` - `const CustomHostnameSSLStatusInactive CustomHostnameSSLStatus = "inactive"` - `const CustomHostnameSSLStatusBackupIssued CustomHostnameSSLStatus = "backup_issued"` - `const CustomHostnameSSLStatusHoldingDeployment CustomHostnameSSLStatus = "holding_deployment"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `UploadedOn Time` The time the custom certificate was uploaded. - `ValidationErrors []CustomHostnameSSLValidationError` Domain validation errors that have been received by the certificate authority (CA). - `Message string` A domain validation error. - `ValidationRecords []CustomHostnameSSLValidationRecord` - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `Wildcard bool` Indicates whether the certificate covers a wildcard. - `Status CustomHostnameStatus` Status of the hostname's activation. - `const CustomHostnameStatusActive CustomHostnameStatus = "active"` - `const CustomHostnameStatusPending CustomHostnameStatus = "pending"` - `const CustomHostnameStatusActiveRedeploying CustomHostnameStatus = "active_redeploying"` - `const CustomHostnameStatusMoved CustomHostnameStatus = "moved"` - `const CustomHostnameStatusPendingDeletion CustomHostnameStatus = "pending_deletion"` - `const CustomHostnameStatusDeleted CustomHostnameStatus = "deleted"` - `const CustomHostnameStatusPendingBlocked CustomHostnameStatus = "pending_blocked"` - `const CustomHostnameStatusPendingMigration CustomHostnameStatus = "pending_migration"` - `const CustomHostnameStatusPendingProvisioned CustomHostnameStatus = "pending_provisioned"` - `const CustomHostnameStatusTestPending CustomHostnameStatus = "test_pending"` - `const CustomHostnameStatusTestActive CustomHostnameStatus = "test_active"` - `const CustomHostnameStatusTestActiveApex CustomHostnameStatus = "test_active_apex"` - `const CustomHostnameStatusTestBlocked CustomHostnameStatus = "test_blocked"` - `const CustomHostnameStatusTestFailed CustomHostnameStatus = "test_failed"` - `const CustomHostnameStatusProvisioned CustomHostnameStatus = "provisioned"` - `const CustomHostnameStatusBlocked CustomHostnameStatus = "blocked"` - `VerificationErrors []string` These are errors that were encountered while trying to activate a hostname. ### DCV Method - `type DCVMethod string` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` ### Domain Validation Type - `type DomainValidationType string` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` # Fallback Origin ## Get Fallback Origin for Custom Hostnames `client.CustomHostnames.FallbackOrigin.Get(ctx, query) (*FallbackOriginGetResponse, error)` **get** `/zones/{zone_id}/custom_hostnames/fallback_origin` Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable. ### Parameters - `query FallbackOriginGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type FallbackOriginGetResponse struct{…}` - `CreatedAt Time` This is the time the fallback origin was created. - `Errors []string` These are errors that were encountered while trying to activate a fallback origin. - `Origin string` Your origin hostname that requests to your custom hostnames will be sent to. - `Status FallbackOriginGetResponseStatus` Status of the fallback origin's activation. - `const FallbackOriginGetResponseStatusInitializing FallbackOriginGetResponseStatus = "initializing"` - `const FallbackOriginGetResponseStatusPendingDeployment FallbackOriginGetResponseStatus = "pending_deployment"` - `const FallbackOriginGetResponseStatusPendingDeletion FallbackOriginGetResponseStatus = "pending_deletion"` - `const FallbackOriginGetResponseStatusActive FallbackOriginGetResponseStatus = "active"` - `const FallbackOriginGetResponseStatusDeploymentTimedOut FallbackOriginGetResponseStatus = "deployment_timed_out"` - `const FallbackOriginGetResponseStatusDeletionTimedOut FallbackOriginGetResponseStatus = "deletion_timed_out"` - `UpdatedAt Time` This is the time the fallback origin was updated. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) fallbackOrigin, err := client.CustomHostnames.FallbackOrigin.Get(context.TODO(), custom_hostnames.FallbackOriginGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fallbackOrigin.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": "2019-10-28T18:11:23.37411Z", "errors": [ "DNS records are not setup correctly. Origin should be a proxied A/AAAA/CNAME dns record" ], "origin": "fallback.example.com", "status": "pending_deployment", "updated_at": "2020-03-16T18:11:23.531995Z" } } ``` ## Update Fallback Origin for Custom Hostnames `client.CustomHostnames.FallbackOrigin.Update(ctx, params) (*FallbackOriginUpdateResponse, error)` **put** `/zones/{zone_id}/custom_hostnames/fallback_origin` Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic. ### Parameters - `params FallbackOriginUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Origin param.Field[string]` Body param: Your origin hostname that requests to your custom hostnames will be sent to. ### Returns - `type FallbackOriginUpdateResponse struct{…}` - `CreatedAt Time` This is the time the fallback origin was created. - `Errors []string` These are errors that were encountered while trying to activate a fallback origin. - `Origin string` Your origin hostname that requests to your custom hostnames will be sent to. - `Status FallbackOriginUpdateResponseStatus` Status of the fallback origin's activation. - `const FallbackOriginUpdateResponseStatusInitializing FallbackOriginUpdateResponseStatus = "initializing"` - `const FallbackOriginUpdateResponseStatusPendingDeployment FallbackOriginUpdateResponseStatus = "pending_deployment"` - `const FallbackOriginUpdateResponseStatusPendingDeletion FallbackOriginUpdateResponseStatus = "pending_deletion"` - `const FallbackOriginUpdateResponseStatusActive FallbackOriginUpdateResponseStatus = "active"` - `const FallbackOriginUpdateResponseStatusDeploymentTimedOut FallbackOriginUpdateResponseStatus = "deployment_timed_out"` - `const FallbackOriginUpdateResponseStatusDeletionTimedOut FallbackOriginUpdateResponseStatus = "deletion_timed_out"` - `UpdatedAt Time` This is the time the fallback origin was updated. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) fallbackOrigin, err := client.CustomHostnames.FallbackOrigin.Update(context.TODO(), custom_hostnames.FallbackOriginUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Origin: cloudflare.F("fallback.example.com"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fallbackOrigin.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": "2019-10-28T18:11:23.37411Z", "errors": [ "DNS records are not setup correctly. Origin should be a proxied A/AAAA/CNAME dns record" ], "origin": "fallback.example.com", "status": "pending_deployment", "updated_at": "2020-03-16T18:11:23.531995Z" } } ``` ## Delete Fallback Origin for Custom Hostnames `client.CustomHostnames.FallbackOrigin.Delete(ctx, body) (*FallbackOriginDeleteResponse, error)` **delete** `/zones/{zone_id}/custom_hostnames/fallback_origin` Removes the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback. ### Parameters - `body FallbackOriginDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type FallbackOriginDeleteResponse struct{…}` - `CreatedAt Time` This is the time the fallback origin was created. - `Errors []string` These are errors that were encountered while trying to activate a fallback origin. - `Origin string` Your origin hostname that requests to your custom hostnames will be sent to. - `Status FallbackOriginDeleteResponseStatus` Status of the fallback origin's activation. - `const FallbackOriginDeleteResponseStatusInitializing FallbackOriginDeleteResponseStatus = "initializing"` - `const FallbackOriginDeleteResponseStatusPendingDeployment FallbackOriginDeleteResponseStatus = "pending_deployment"` - `const FallbackOriginDeleteResponseStatusPendingDeletion FallbackOriginDeleteResponseStatus = "pending_deletion"` - `const FallbackOriginDeleteResponseStatusActive FallbackOriginDeleteResponseStatus = "active"` - `const FallbackOriginDeleteResponseStatusDeploymentTimedOut FallbackOriginDeleteResponseStatus = "deployment_timed_out"` - `const FallbackOriginDeleteResponseStatusDeletionTimedOut FallbackOriginDeleteResponseStatus = "deletion_timed_out"` - `UpdatedAt Time` This is the time the fallback origin was updated. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) fallbackOrigin, err := client.CustomHostnames.FallbackOrigin.Delete(context.TODO(), custom_hostnames.FallbackOriginDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fallbackOrigin.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": "2019-10-28T18:11:23.37411Z", "errors": [ "DNS records are not setup correctly. Origin should be a proxied A/AAAA/CNAME dns record" ], "origin": "fallback.example.com", "status": "pending_deployment", "updated_at": "2020-03-16T18:11:23.531995Z" } } ``` # Certificate Pack # Certificates ## Replace Custom Certificate and Custom Key In Custom Hostname `client.CustomHostnames.CertificatePack.Certificates.Update(ctx, customHostnameID, certificatePackID, certificateID, params) (*CertificatePackCertificateUpdateResponse, error)` **put** `/zones/{zone_id}/custom_hostnames/{custom_hostname_id}/certificate_pack/{certificate_pack_id}/certificates/{certificate_id}` Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate. ### Parameters - `customHostnameID string` Identifier. - `certificatePackID string` Identifier. - `certificateID string` Identifier. - `params CertificatePackCertificateUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `CustomCertificate param.Field[string]` Body param: If a custom uploaded certificate is used. - `CustomKey param.Field[string]` Body param: The key for a custom uploaded certificate. ### Returns - `type CertificatePackCertificateUpdateResponse struct{…}` - `ID string` Identifier. - `Hostname string` The custom hostname that will point to your hostname via CNAME. - `CreatedAt Time` This is the time the hostname was created. - `CustomMetadata map[string, string]` Unique key/value metadata for this hostname. These are per-hostname (customer) settings. - `CustomOriginServer string` a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record. - `CustomOriginSNI string` A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server. - `OwnershipVerification CertificatePackCertificateUpdateResponseOwnershipVerification` This is a record which can be placed to activate a hostname. - `Name string` DNS Name for record. - `Type CertificatePackCertificateUpdateResponseOwnershipVerificationType` DNS Record type. - `const CertificatePackCertificateUpdateResponseOwnershipVerificationTypeTXT CertificatePackCertificateUpdateResponseOwnershipVerificationType = "txt"` - `Value string` Content for the record. - `OwnershipVerificationHTTP CertificatePackCertificateUpdateResponseOwnershipVerificationHTTP` This presents the token to be served by the given http url to activate a hostname. - `HTTPBody string` Token to be served. - `HTTPURL string` The HTTP URL that will be checked during custom hostname verification and where the customer should host the token. - `SSL CertificatePackCertificateUpdateResponseSSL` - `ID string` Custom hostname SSL identifier tag. - `BundleMethod BundleMethod` A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - `const BundleMethodUbiquitous BundleMethod = "ubiquitous"` - `const BundleMethodOptimal BundleMethod = "optimal"` - `const BundleMethodForce BundleMethod = "force"` - `CertificateAuthority CertificateCA` The Certificate Authority that will issue the certificate - `const CertificateCADigicert CertificateCA = "digicert"` - `const CertificateCAGoogle CertificateCA = "google"` - `const CertificateCALetsEncrypt CertificateCA = "lets_encrypt"` - `const CertificateCASSLCom CertificateCA = "ssl_com"` - `CustomCertificate string` If a custom uploaded certificate is used. - `CustomCsrID string` The identifier for the Custom CSR that was used. - `CustomKey string` The key for a custom uploaded certificate. - `DCVDelegationRecords []CertificatePackCertificateUpdateResponseSsldcvDelegationRecord` DCV Delegation records for domain validation. - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `ExpiresOn Time` The time the custom certificate expires on. - `Hosts []string` A list of Hostnames on a custom uploaded certificate. - `Issuer string` The issuer on a custom uploaded certificate. - `Method DCVMethod` Domain control validation (DCV) method used for this hostname. - `const DCVMethodHTTP DCVMethod = "http"` - `const DCVMethodTXT DCVMethod = "txt"` - `const DCVMethodEmail DCVMethod = "email"` - `SerialNumber string` The serial number on a custom uploaded certificate. - `Settings CertificatePackCertificateUpdateResponseSSLSettings` - `Ciphers []string` An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. - `EarlyHints CertificatePackCertificateUpdateResponseSSLSettingsEarlyHints` Whether or not Early Hints is enabled. - `const CertificatePackCertificateUpdateResponseSSLSettingsEarlyHintsOn CertificatePackCertificateUpdateResponseSSLSettingsEarlyHints = "on"` - `const CertificatePackCertificateUpdateResponseSSLSettingsEarlyHintsOff CertificatePackCertificateUpdateResponseSSLSettingsEarlyHints = "off"` - `HTTP2 CertificatePackCertificateUpdateResponseSSLSettingsHTTP2` Whether or not HTTP2 is enabled. - `const CertificatePackCertificateUpdateResponseSSLSettingsHTTP2On CertificatePackCertificateUpdateResponseSSLSettingsHTTP2 = "on"` - `const CertificatePackCertificateUpdateResponseSSLSettingsHTTP2Off CertificatePackCertificateUpdateResponseSSLSettingsHTTP2 = "off"` - `MinTLSVersion CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion` The minimum TLS version supported. - `const CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion1_0 CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion = "1.0"` - `const CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion1_1 CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion = "1.1"` - `const CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion1_2 CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion = "1.2"` - `const CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion1_3 CertificatePackCertificateUpdateResponseSSLSettingsMinTLSVersion = "1.3"` - `TLS1_3 CertificatePackCertificateUpdateResponseSSLSettingsTLS1_3` Whether or not TLS 1.3 is enabled. - `const CertificatePackCertificateUpdateResponseSSLSettingsTLS1_3On CertificatePackCertificateUpdateResponseSSLSettingsTLS1_3 = "on"` - `const CertificatePackCertificateUpdateResponseSSLSettingsTLS1_3Off CertificatePackCertificateUpdateResponseSSLSettingsTLS1_3 = "off"` - `Signature string` The signature on a custom uploaded certificate. - `Status CertificatePackCertificateUpdateResponseSSLStatus` Status of the hostname's SSL certificates. - `const CertificatePackCertificateUpdateResponseSSLStatusInitializing CertificatePackCertificateUpdateResponseSSLStatus = "initializing"` - `const CertificatePackCertificateUpdateResponseSSLStatusPendingValidation CertificatePackCertificateUpdateResponseSSLStatus = "pending_validation"` - `const CertificatePackCertificateUpdateResponseSSLStatusDeleted CertificatePackCertificateUpdateResponseSSLStatus = "deleted"` - `const CertificatePackCertificateUpdateResponseSSLStatusPendingIssuance CertificatePackCertificateUpdateResponseSSLStatus = "pending_issuance"` - `const CertificatePackCertificateUpdateResponseSSLStatusPendingDeployment CertificatePackCertificateUpdateResponseSSLStatus = "pending_deployment"` - `const CertificatePackCertificateUpdateResponseSSLStatusPendingDeletion CertificatePackCertificateUpdateResponseSSLStatus = "pending_deletion"` - `const CertificatePackCertificateUpdateResponseSSLStatusPendingExpiration CertificatePackCertificateUpdateResponseSSLStatus = "pending_expiration"` - `const CertificatePackCertificateUpdateResponseSSLStatusExpired CertificatePackCertificateUpdateResponseSSLStatus = "expired"` - `const CertificatePackCertificateUpdateResponseSSLStatusActive CertificatePackCertificateUpdateResponseSSLStatus = "active"` - `const CertificatePackCertificateUpdateResponseSSLStatusInitializingTimedOut CertificatePackCertificateUpdateResponseSSLStatus = "initializing_timed_out"` - `const CertificatePackCertificateUpdateResponseSSLStatusValidationTimedOut CertificatePackCertificateUpdateResponseSSLStatus = "validation_timed_out"` - `const CertificatePackCertificateUpdateResponseSSLStatusIssuanceTimedOut CertificatePackCertificateUpdateResponseSSLStatus = "issuance_timed_out"` - `const CertificatePackCertificateUpdateResponseSSLStatusDeploymentTimedOut CertificatePackCertificateUpdateResponseSSLStatus = "deployment_timed_out"` - `const CertificatePackCertificateUpdateResponseSSLStatusDeletionTimedOut CertificatePackCertificateUpdateResponseSSLStatus = "deletion_timed_out"` - `const CertificatePackCertificateUpdateResponseSSLStatusPendingCleanup CertificatePackCertificateUpdateResponseSSLStatus = "pending_cleanup"` - `const CertificatePackCertificateUpdateResponseSSLStatusStagingDeployment CertificatePackCertificateUpdateResponseSSLStatus = "staging_deployment"` - `const CertificatePackCertificateUpdateResponseSSLStatusStagingActive CertificatePackCertificateUpdateResponseSSLStatus = "staging_active"` - `const CertificatePackCertificateUpdateResponseSSLStatusDeactivating CertificatePackCertificateUpdateResponseSSLStatus = "deactivating"` - `const CertificatePackCertificateUpdateResponseSSLStatusInactive CertificatePackCertificateUpdateResponseSSLStatus = "inactive"` - `const CertificatePackCertificateUpdateResponseSSLStatusBackupIssued CertificatePackCertificateUpdateResponseSSLStatus = "backup_issued"` - `const CertificatePackCertificateUpdateResponseSSLStatusHoldingDeployment CertificatePackCertificateUpdateResponseSSLStatus = "holding_deployment"` - `Type DomainValidationType` Level of validation to be used for this hostname. Domain validation (dv) must be used. - `const DomainValidationTypeDv DomainValidationType = "dv"` - `UploadedOn Time` The time the custom certificate was uploaded. - `ValidationErrors []CertificatePackCertificateUpdateResponseSSLValidationError` Domain validation errors that have been received by the certificate authority (CA). - `Message string` A domain validation error. - `ValidationRecords []CertificatePackCertificateUpdateResponseSSLValidationRecord` - `CNAME string` The CNAME record hostname for DCV delegation. - `CNAMETarget string` The CNAME record target value for DCV delegation. - `Emails []string` The set of email addresses that the certificate authority (CA) will use to complete domain validation. - `HTTPBody string` The content that the certificate authority (CA) will expect to find at the http_url during the domain validation. - `HTTPURL string` The url that will be checked during domain validation. - `Status string` Status of the validation record. - `TXTName string` The hostname that the certificate authority (CA) will check for a TXT record during domain validation . - `TXTValue string` The TXT record that the certificate authority (CA) will check during domain validation. - `Wildcard bool` Indicates whether the certificate covers a wildcard. - `Status CertificatePackCertificateUpdateResponseStatus` Status of the hostname's activation. - `const CertificatePackCertificateUpdateResponseStatusActive CertificatePackCertificateUpdateResponseStatus = "active"` - `const CertificatePackCertificateUpdateResponseStatusPending CertificatePackCertificateUpdateResponseStatus = "pending"` - `const CertificatePackCertificateUpdateResponseStatusActiveRedeploying CertificatePackCertificateUpdateResponseStatus = "active_redeploying"` - `const CertificatePackCertificateUpdateResponseStatusMoved CertificatePackCertificateUpdateResponseStatus = "moved"` - `const CertificatePackCertificateUpdateResponseStatusPendingDeletion CertificatePackCertificateUpdateResponseStatus = "pending_deletion"` - `const CertificatePackCertificateUpdateResponseStatusDeleted CertificatePackCertificateUpdateResponseStatus = "deleted"` - `const CertificatePackCertificateUpdateResponseStatusPendingBlocked CertificatePackCertificateUpdateResponseStatus = "pending_blocked"` - `const CertificatePackCertificateUpdateResponseStatusPendingMigration CertificatePackCertificateUpdateResponseStatus = "pending_migration"` - `const CertificatePackCertificateUpdateResponseStatusPendingProvisioned CertificatePackCertificateUpdateResponseStatus = "pending_provisioned"` - `const CertificatePackCertificateUpdateResponseStatusTestPending CertificatePackCertificateUpdateResponseStatus = "test_pending"` - `const CertificatePackCertificateUpdateResponseStatusTestActive CertificatePackCertificateUpdateResponseStatus = "test_active"` - `const CertificatePackCertificateUpdateResponseStatusTestActiveApex CertificatePackCertificateUpdateResponseStatus = "test_active_apex"` - `const CertificatePackCertificateUpdateResponseStatusTestBlocked CertificatePackCertificateUpdateResponseStatus = "test_blocked"` - `const CertificatePackCertificateUpdateResponseStatusTestFailed CertificatePackCertificateUpdateResponseStatus = "test_failed"` - `const CertificatePackCertificateUpdateResponseStatusProvisioned CertificatePackCertificateUpdateResponseStatus = "provisioned"` - `const CertificatePackCertificateUpdateResponseStatusBlocked CertificatePackCertificateUpdateResponseStatus = "blocked"` - `VerificationErrors []string` These are errors that were encountered while trying to activate a hostname. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) certificate, err := client.CustomHostnames.CertificatePack.Certificates.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", custom_hostnames.CertificatePackCertificateUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n"), CustomKey: cloudflare.F("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", certificate.ID) } ``` #### 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": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "hostname": "app.example.com", "created_at": "2020-02-06T18:11:23.531995Z", "custom_metadata": { "foo": "string" }, "custom_origin_server": "origin2.example.com", "custom_origin_sni": "sni.example.com", "ownership_verification": { "name": "_cf-custom-hostname.app.example.com", "type": "txt", "value": "5cc07c04-ea62-4a5a-95f0-419334a875a4" }, "ownership_verification_http": { "http_body": "5cc07c04-ea62-4a5a-95f0-419334a875a4", "http_url": "http://custom.test.com/.well-known/cf-custom-hostname-challenge/0d89c70d-ad9f-4843-b99f-6cc0252067e9" }, "ssl": { "id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9", "bundle_method": "ubiquitous", "certificate_authority": "google", "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "dcv_delegation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "expires_on": "2021-02-06T18:11:23.531995Z", "hosts": [ "app.example.com", "*.app.example.com" ], "issuer": "DigiCertInc", "method": "http", "serial_number": "6743787633689793699141714808227354901", "settings": { "ciphers": [ "ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA" ], "early_hints": "on", "http2": "on", "min_tls_version": "1.2", "tls_1_3": "on" }, "signature": "SHA256WithRSA", "status": "pending_validation", "type": "dv", "uploaded_on": "2020-02-06T18:11:23.531995Z", "validation_errors": [ { "message": "SERVFAIL looking up CAA for app.example.com" } ], "validation_records": [ { "cname": "_acme-challenge.example.com", "cname_target": "dcv.cloudflare.com", "emails": [ "administrator@example.com", "webmaster@example.com" ], "http_body": "ca3-574923932a82475cb8592200f1a2a23d", "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt", "status": "pending", "txt_name": "_acme-challenge.app.example.com", "txt_value": "810b7d5f01154524b961ba0cd578acc2" } ], "wildcard": false }, "status": "pending", "verification_errors": [ "None of the A or AAAA records are owned by this account and the pre-generated ownership verification token was not found." ] } } ``` ## Delete Single Certificate And Key For Custom Hostname `client.CustomHostnames.CertificatePack.Certificates.Delete(ctx, customHostnameID, certificatePackID, certificateID, body) (*CertificatePackCertificateDeleteResponse, error)` **delete** `/zones/{zone_id}/custom_hostnames/{custom_hostname_id}/certificate_pack/{certificate_pack_id}/certificates/{certificate_id}` Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack. ### Parameters - `customHostnameID string` Identifier. - `certificatePackID string` Identifier. - `certificateID string` Identifier. - `body CertificatePackCertificateDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type CertificatePackCertificateDeleteResponse struct{…}` - `ID string` Identifier. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/custom_hostnames" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) certificate, err := client.CustomHostnames.CertificatePack.Certificates.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", custom_hostnames.CertificatePackCertificateDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", certificate.ID) } ``` #### Response ```json { "id": "023e105f4ecef8ad9ca31a8372d0c353" } ```