---
title: Get the Hostname Client Certificate
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Origin TLS Client Auth](https://developers.cloudflare.com/api/go/resources/origin_tls_client_auth)

[Hostname Certificates](https://developers.cloudflare.com/api/go/resources/origin_tls_client_auth/subresources/hostname_certificates)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Get the Hostname Client Certificate

client.OriginTLSClientAuth.HostnameCertificates.Get(ctx, certificateID, query) (\*[HostnameCertificateGetResponse](<https://developers.cloudflare.com/api/go/resources/origin_tls_client_auth#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)>), error)

GET/zones/{zone\_id}/origin\_tls\_client\_auth/hostnames/certificates/{certificate\_id}

Get the certificate by ID to be used for client authentication on a hostname.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`SSL and Certificates Write``SSL and Certificates Read`

##### ParametersExpand Collapse

certificateID string

Certificate identifier tag.

maxLength36

[Link to this property](<#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20certificate_id%20%3E%20(schema)>)

<details>

<summary>

query HostnameCertificateGetParams

</summary>

ZoneID param.Field\[string]

Identifier.

maxLength32

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(method)%20get%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type HostnameCertificateGetResponse struct{…}

</summary>

ID stringOptional

Certificate identifier tag.

maxLength36

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Certificate stringOptional

The hostname certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20certificate">Link to this property</a>

ExpiresOn TimeOptional

The date when the certificate expires.

formatdate-time

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20expires_on">Link to this property</a>

Issuer stringOptional

The certificate authority that issued the certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20issuer">Link to this property</a>

SerialNumber stringOptional

The serial number on the uploaded certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20serial_number">Link to this property</a>

Signature stringOptional

The type of hash used for the certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20signature">Link to this property</a>

<details>

<summary>

Status HostnameCertificateGetResponseStatusOptional

Status of the certificate or the association.

</summary>

One of the following:

const HostnameCertificateGetResponseStatusInitializing HostnameCertificateGetResponseStatus = "initializing"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const HostnameCertificateGetResponseStatusPendingDeployment HostnameCertificateGetResponseStatus = "pending\_deployment"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const HostnameCertificateGetResponseStatusPendingDeletion HostnameCertificateGetResponseStatus = "pending\_deletion"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

const HostnameCertificateGetResponseStatusActive HostnameCertificateGetResponseStatus = "active"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%203">Link to this property</a>

const HostnameCertificateGetResponseStatusDeleted HostnameCertificateGetResponseStatus = "deleted"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%204">Link to this property</a>

const HostnameCertificateGetResponseStatusDeploymentTimedOut HostnameCertificateGetResponseStatus = "deployment\_timed\_out"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%205">Link to this property</a>

const HostnameCertificateGetResponseStatusDeletionTimedOut HostnameCertificateGetResponseStatus = "deletion\_timed\_out"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%206">Link to this property</a>

</details>

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

UploadedOn TimeOptional

The time when the certificate was uploaded.

formatdate-time

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)%20%3E%20(property)%20uploaded_on">Link to this property</a>

</details>

[Link to this property](<#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20HostnameCertificateGetResponse%20%3E%20(schema)>)

### Get the Hostname Client Certificate

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/origin_tls_client_auth"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  hostnameCertificate, err := client.OriginTLSClientAuth.HostnameCertificates.Get(
    context.TODO(),
    "2458ce5a-0c35-4c7f-82c7-8e9487d3ff60",
    origin_tls_client_auth.HostnameCertificateGetParams{
      ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", hostnameCertificate.ID)
}
```

200 example

```
{
  "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": "2458ce5a-0c35-4c7f-82c7-8e9487d3ff60",
    "certificate": "-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMT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yLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n",
    "expires_on": "2100-01-01T05:20:00Z",
    "issuer": "GlobalSign",
    "serial_number": "6743787633689793699141714808227354901",
    "signature": "SHA256WithRSA",
    "status": "active",
    "uploaded_on": "2019-10-28T18:11:23.37411Z"
  }
}
```

##### Returns Examples

200 example

```
{
  "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": "2458ce5a-0c35-4c7f-82c7-8e9487d3ff60",
    "certificate": "-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n",
    "expires_on": "2100-01-01T05:20:00Z",
    "issuer": "GlobalSign",
    "serial_number": "6743787633689793699141714808227354901",
    "signature": "SHA256WithRSA",
    "status": "active",
    "uploaded_on": "2019-10-28T18:11:23.37411Z"
  }
}
```