---
title: "Request best SSL domain for service"
method: GET
path: "/SSL/get_cn_name"
tags: ["SSL", "cPanel Account SSL Management"]
---

# Request best SSL domain for service

`GET /SSL/get_cn_name`

This function retrieves the most secure domain for a service.

## Query parameters

- `domain` union, required
  - string, domain — A valid domain.
  - string, email — A valid email address.
  - string, username — A valid cPanel username.
- `service` 'cpanel' | 'imap' | 'pop3' | 'smtp', required
- `add_mail_subdomain` 1 | 0

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` 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 certificate with the mail service. * `none` — No domain matches the certificate. * `exact` — The domain exactly matches the certificate. * `exact-wildcard` — The domain exactly matches the 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` — A `mail` subdomain of a domain on the server that matches the certificate. * `localdomain_on_cert-www-wildcard` — A `www` subdomain of a domain on the server matches the certificate. * `localdomain_on_cert` — A domain on the server matches the certificate.
      - `cert_valid_not_after` integer — The certificate's expiration date.
      - `is_currently_valid` 1 | 0 — Whether the certificate is currently valid. * `1` — Valid. * `0` — Invalid. **Note:** If the certificate is valid, the following statements are true: * The certificate is **not** self-signed (the `ssldomain_matches_cert` value is `1`). * 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` 1 | 0 — Whether the certificate is self-signed. * `1` — Self-signed. * `0` — Not self-signed. **Note:** If the `cert_match_method` value is `none`, you should ignore this return's value.
      - `is_wild_card` 1 | 0 — Whether the certificate is a wildcard certificate. * `1` — Wildcard. * `0` — Not a wildcard.
      - `ssldomain` string, domain — The best domain to use to access the service.
      - `ssldomain_matches_cert` 1 | 0 — Whether an SSL-protected domain matches the certificate. * `1` — Matches. * `0` — Does **not** match.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
    - `status` 1 | 0 — * `1` — Success. * `0` — Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

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