Skip to main content

hostnames

Creates, updates, deletes, gets or lists a hostnames resource.

Overview

Namehostnames
TypeResource
Idcloudflare.origin_tls_client_auth.hostnames

Fields

The following fields are returned by SELECT queries:

Get the Hostname Status for Client Authentication response

NameDatatypeDescription
cert_idstringIdentifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
cert_statusstringStatus of the certificate or the association. (initializing, pending_deployment, pending_deletion, active, deleted, deployment_timed_out, deletion_timed_out) (example: active)
cert_updated_atstring (date-time)The time when the certificate was updated. (example: 2100-01-01T05:20:00Z)
cert_uploaded_onstring (date-time)The time when the certificate was uploaded. (example: 2019-10-28T18:11:23.37411Z)
certificatestringThe hostname certificate. (example: -----BEGIN CERTIFICATE-----
MIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
aWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF
MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50
ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1
CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB
KwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5
0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI
dZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2
izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4
9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI
GKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV
BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF
MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2
2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP
Mlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG
SvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq
2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw
YbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=
-----END CERTIFICATE-----
)
created_atstring (date-time)The time when the certificate was created. (example: 2100-01-01T05:20:00Z)
enabledbooleanIndicates whether hostname-level authenticated origin pulls is enabled. A null value voids the association.
expires_onstring (date-time)The date when the certificate expires. (example: 2100-01-01T05:20:00Z)
hostnamestringThe hostname on the origin for which the client certificate uploaded will be used. (example: app.example.com)
issuerstringThe certificate authority that issued the certificate. (example: GlobalSign)
serial_numberstringThe serial number on the uploaded certificate. (example: 6743787633689793699141714808227354901)
signaturestringThe type of hash used for the certificate. (example: SHA256WithRSA)
statusstringStatus of the certificate or the association. (initializing, pending_deployment, pending_deletion, active, deleted, deployment_timed_out, deletion_timed_out) (example: active)
updated_atstring (date-time)The time when the certificate was updated. (example: 2100-01-01T05:20:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecthostname, zone_idRetrieves the client certificate authentication status for a specific hostname, showing whether authenticated origin pulls are enabled.
listselectzone_idpage, per_page, statusList certificate ID - hostname associations for the given zone. Shows which hostnames are associated to which certificates for authenticated origin pulls.
per_hostname_authenticated_origin_pull_enable_or_disable_a_hostname_for_client_authenticationreplacezone_id, configAssociate a hostname to a certificate and enable, disable or invalidate the association. If disabled, client certificate will not be sent to the hostname even if activated at the zone level. 100 maximum associations on a single certificate are allowed. Note: Use a null value for parameter enabled to invalidate the association.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
hostnamestring
zone_idstringThe Cloudflare zone ID.
pagenumber
per_pagenumber
statusstring

SELECT examples

Retrieves the client certificate authentication status for a specific hostname, showing whether authenticated origin pulls are enabled.

SELECT
cert_id,
cert_status,
cert_updated_at,
cert_uploaded_on,
certificate,
created_at,
enabled,
expires_on,
hostname,
issuer,
serial_number,
signature,
status,
updated_at
FROM cloudflare.origin_tls_client_auth.hostnames
WHERE hostname = '{{ hostname }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;

REPLACE examples

Associate a hostname to a certificate and enable, disable or invalidate the association. If disabled, client certificate will not be sent to the hostname even if activated at the zone level. 100 maximum associations on a single certificate are allowed. Note: Use a null value for parameter enabled to invalidate the association.

REPLACE cloudflare.origin_tls_client_auth.hostnames
SET
config = '{{ config }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND config = '{{ config }}' --required
RETURNING
errors,
messages,
result,
result_info,
success;