---
title: "Return SSL-encrypted domain for service access"
method: GET
path: "/get_best_ssldomain_for_service"
tags: ["SSL", "cPanel Account Settings"]
---

# Return SSL-encrypted domain for service access

`GET /get_best_ssldomain_for_service`

This function retrieves the most appropriate SSL-encrypted domain to use to access a service.

## Query parameters

- `service` string, required

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `cert_match_method` 'none' | 'exact' | 'exact-wildcard' | 'mail-wildcard' | 'www-wildcard' | 'hostname-wildcard' | 'hostname' | 'localdomain_on_cert-mail-wildcard' | 'localdomain_on_cert-www-wildcard' | 'localdomain_on_cert' — The method that the system used to match the domain with the certificate. * `none` — No domain matches the certificate. * `exact` — The domain exactly matches the certificate. * `exact-wildcard` — The domain exactly matches the domain of a wildcard certificate. * `mail-wildcard` — The mail subdomain of the domain matches the domain of the wildcard certificate. * `www-wildcard` — The `www` subdomain of the domain matches the domain of the wildcard certificate. * `hostname-wildcard` — The hostname's domain matches the domain of the wildcard certificate. * `hostname` — The hostname matches the domain of the certificate. * `localdomain_on_cert-mail-wildcard` — Any `mail` subdomain of any domain on the server matches the certificate. * `localdomain_on_cert-www-wildcard` — Any `www` subdomain of any domain on the server matches the certificate. * `localdomain_on_cert` — Any domain on the server matches the certificate.
    - `cert_valid_not_after` integer — The expiration date of the certificate.
    - `is_currently_valid` 0 | 1 — Whether the certificate is currently valid. * `1` — The certificate is valid. * `0` — The certificate is **not** valid. **Note:** If the certificate is valid, the following statements are true: * The certificate is **not** self-signed (the `is_self_signed` value is `0`). * The certificate matches the SSL domain (the `ssldomain_matches_cert` value is `1`). * The certificate is within its validity period (the `cert_valid_not_after` value is less than the current time and date).
    - `is_self_signed` 0 | 1 — Whether the certificate is self-signed. * `1` — The certificate is self-signed. * `0` — The certificate is **not** self-signed. **Note:** For legacy reasons, if the `ssldomain_matches_cert` value is `0`, then the function will **always** return a value of `1` for the `is_self_signed return` return, regardless of whether the certificate is actually self-signed.
    - `is_wild_card` 0 | 1 — Whether the service uses a wildcard certificate. * `1` — The service uses a wildcard certificate. * `0` — The service does **not** use a wildcard certificate.
    - `ssldomain` string, domain — The domain of the service's SSL certificate.
    - `ssldomain_matches_cert` 0 | 1 — Whether an SSL-encrypted domain matches the certificate. * `1` — Matches. * `0` — Does **not** match.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` - Success * `0` - Failed: Check the reason field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
