---
title: "Return server vhosts and SSL certificates"
method: GET
path: "/fetch_ssl_vhosts"
tags: ["SSL", "cPanel Account Settings"]
---

# Return server vhosts and SSL certificates

`GET /fetch_ssl_vhosts`

This function lists the server's virtual hosts (vhosts) and their installed SSL certificates.

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `vhosts` object[] — An array of objects containing virtual host information.
      - `crt` object — Information about the certificate.
        - `created` integer — The date the certificate was created.
        - `domains` string[] — A list of the certificate's associated domains.
        - `ecdsa_curve_name` 'prime256v1' | 'secp384r1', nullable — The ECDSA curve that the certificate's key uses. * `prime256v1` * `secp384r1` * `null` — The certificate's key is **not** an ECDSA key.
        - `ecdsa_public` string, nullable — The certificate's key's ECDSA compressed public point, in hexadecimal format. * `null` — The certificate's key is **not** an ECDSA key.
        - `encryption_algorithm` 'rsaEncryption' | 'id-ecPublicKey' — The certificate's key's algorithm. * `rsaEncryption` — RSA. * `id-ecPublicKey` — ECDSA.
        - `id` string — The certificate's ID.
        - `is_self_signed` 1 | 0 — Whether the certificate is self-signed. * `1` — Self-signed. * `0` — Not self-signed.
        - `issuer.commonName` string — The certificate's issuer.
        - `issuer.organizationName` string — The certificate's Organization Name.
        - `issuer_text` string — The full text of issuer information.
        - `modulus` string, nullable — The certificate's key's modulus, in hexadecimal format. * `null` — The certificate's key is **not** an RSA key.
        - `modulus_length` integer, nullable — The certificate's key's modulus length. * `null` — The certificate's key is **not** an RSA key.
        - `not_after` integer — The date the certificate expires.
        - `not_before` integer — The date the certificate became active.
        - `public_exponent` string — The certificate's exponent.
        - `signature_algorithm` string — The certificate's OID hash algorithm.
        - `subject.commonName` object — An object containing the certificate's Common Name.
          - `commonName` string — The certificate's Common Name.
        - `subject_text` string — The certificate's subject text.
        - `validation_type` 'dv' | 'ev' | 'ov', nullable — The certificate's validation type. * `dv` — Domain validation. * `ev` — Extended validation. * `ov` — Organizational validation. * `null` — Self-signed certificate.
      - `docroot` string, path — The absolute directory path of the primary domain's document root.
      - `domains` string[] — A list of the virtual host's domains.
      - `ip` string, ipv4 — The virtual host's IP address.
      - `iptype` 'shared' | 'dedicated' — The type of IP address. * `shared` * `dedicated`
      - `ipv6` string, ipv6 — The virtual host's IPv6 address.
      - `is_primary_on_ip` 1 | 0 — Whether the certificate's domain is the IP address's primary domain. * `1` — Primary domain. * `0` — **Not** the primary domain.
      - `mail_sni_status` 1 | 0 — Whether SNI for mail is enabled. * `1` — Enabled. * `0` — Disabled.
      - `needs_sni` 1 | 0 — Whether the virtual host requires SNI to function properly for SSL certificates. * `1` — Requires SNI. * `0` — Does **not** require SNI.
      - `servername` string, domain — The virtual host's primary domain.
      - `type` 'addon' | 'main' | 'parked' | 'sub' — The virtual host's domain type. * `addon` — Addon domain. * `main` — Main domain on account. * `parked` — Parked domain. * `sub` — Subomain.
      - `user` string, username — The virtual host's username.
  - `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` 1 | 0 — * `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)
