Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function retrieves a list of the account's websites, their domains, and certificate information.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/SSL/installed_hosts

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve a list of the account's sites, and their corresponding domains and certificate information.
$SSL_installed_hosts = $cpanel->uapi(
    'SSL', 'installed_hosts'
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve a list of the account's sites, and their corresponding domains and certificate information.
my $SSL_installed_hosts = $cpliveapi->uapi(
    'SSL', 'installed_hosts',
);

Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- Retrieve a list of the account's sites, and their corresponding domains and certificate information. -->
[% data = execute( 'SSL', 'installed_hosts', ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username SSL installed_hosts

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
 "messages": null,
  "errors": null,
  "status": 1,
  "data": [
    {
      "certificate": {
        "is_self_signed": "1",
        "validation_type": "dv",
        "signature_algorithm":"sha256WithRSAEncryption",
        "issuer.organizationName": "Example",
        "modulus": "a74f7636fa6ac93ee6836a83a995b55deb5019ea36d7ba3dafb00e38d693acdb0c81b2ff777d6b433a420fae523f127f352a68bcc8b8f2d6ee7b70395bafabd8237ada8164fdddf8376b30375c35d4d4cbcce7d33d08069c17b409176a3689f1ebc97c0b08fe6ae44c19a92ac6d68448e7f1d13f3b360affd4222a51b4f35342de99b5a1fb5548e438f2d824664562a448002eed7fce24dedc7dc3e1ed179973d1dae959b33716eeb410d172708954e00632cbf60a0e26419860c8c0bc285d6bfe4b479de0dd189772a5dae676bd2a92acccc1369821be8cffddd8a7e6ecc061f8a32a9ae0661e4e946ed8e3827b277138d3a76116567cbd129cbd869ef9dddf",
        "subject.commonName": "example.com",
        "not_before": "1365633490",
        "modulus_length": "2048",
        "not_after": "1397169490",
        "created": "1365633887",
        "domains": [
          "example.com"
        ],
        "issuer.commonName": "example.com",
        "id": "example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041",
        "issuer_text":
 
"commonName\nexample.com\ncountryName\nUS\nemailAddress\nusername@example.com\norganizationName\nExample\nstateOrProvinceName\nTexas\nlocalityName\nHouston"
      },
      "certificate_text": "-----BEGIN CERTIFICATE-----
MIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ
c2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI
DAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy
MjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV
BAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P
Xx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW
voK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da
M3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC
+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6
PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj
UDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw
+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
A4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh
cDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw
FYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh
/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag
qz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa
Km6r7YmwfLN/YMZBHXSR58oOGP9W
-----END CERTIFICATE-----",
      "ip": "192.168.0.20",
      "needs_sni": 0,
	  "domains": [
        "example.com"
      ],
      "servername": "example.com",
      "docroot": "\/home\/username\/public_html",
      "is_primary_on_ip": 1,
      "fqdns":[  
        "www.example.com",
        "cpanel.example.com",
        "example.com",
        "mail.example.com",
        "webdisk.example.com",
        "webmail.example.com",
        "autodiscover.example.com"
      ]
    }
  ],
  "metadata": {
    "transformed": 1
  }
}

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
certificatehashA hash of information about each certificate.This hash includes the is_self_signed , issuer.organizationName, modulus, subject.commonName, not_before, modulus_length, not_after, created, domains, issuer.commonName, id signature_algorithm , validation_type , and issuer returns. 

is_self_signed

Boolean

Whether the certificate is self-signed.

The function returns this value in the certificate hash.

  • 1 — Self-signed.
  • 0Not self-signed.
                1
              

validation_type

string

The certificate's validation type.

Note:

We introduced this return in cPanel & WHM version 56.

The function returns this value in the certificate hash.

  • ev — Extended Validation.
  • ov — Organization Validation.
  • dv — Domain Validation.
  • undef — The system could not parse and determine the certificate's validation type.
dv

signature_algorithm

string

The signature algorithm of the certificate.

Note:

We introduced this return in cPanel & WHM version 56.

The function returns this value in the certificate hash.

A valid OID hash algorithm name.
sha256WithRSAEncryption

issuer.organizationName

string

The certificate's organization name.

The function returns this value in the certificate hash.

A valid string.The Example Organization

modulus

string

The certificate's modulus.

The function returns this value in the certificate hash.

A valid string.

 Click to view...
                        a74f7636fa6ac93ee6836a83a995b55deb5019ea36d7ba3dafb00e38d693acdb0c81b2ff777d6b433a420fae523f127f352a68bcc8b8f2d6ee7b70395bafabd8237ada8164fdddf8376b30375c35d4d4cbcce7d33d08069c17b409176a3689f1ebc97c0b08fe6ae44c19a92ac6d68448e7f1d13f3b360affd4222a51b4f35342de99b5a1fb5548e438f2d824664562a448002eed7fce24dedc7dc3e1ed179973d1dae959b33716eeb410d172708954e00632cbf60a0e26419860c8c0bc285d6bfe4b479de0dd189772a5dae676bd2a92acccc1369821be8cffddd8a7e6ecc061f8a32a9ae0661e4e946ed8e3827b277138d3a76116567cbd129cbd869ef9dddf 

subject.commonName

string

The certificate's common name.

The function returns this value in the certificate hash.

A valid domain.
example.com

not_before

string

When the certificate started.

The function returns this value in the certificate hash.

A date in Unix time format.

1415123822

modulus_length

string

The length of the certificate's modulus.

The function returns this value in the certificate hash.

A positive integer.
2048

not_after

string

When the certificate expired.

The function returns this value in the certificate hash.

A date in Unix time format.

1446659822

created

string

When the certificate was created.

The function returns this value in the certificate hash.

A date in Unix time format.

1415123822

domains

array

The domains that the certificate covers.

The function returns this parameter in the certificate hash.

A valid domain or domains.
example.com

issuer.commonName

string

The name that issued the certificate.

The function returns this value in the certificate hash.

Usually, a valid domain.
example.com

id

string

The certificate's ID.

The function returns this value in the certificate hash.

A valid string.
 Click to view...
example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff

issuer_text

string

The issuer's X.509 information.

The function returns this value in the certificate hash.

A valid string.
 Click to view...
commonName\nexample.com\ncountryName\nUS\nemailAddress\nusername@example.com\norganizationName\nExample\nstateOrProvinceName\nTexas\nlocalityName\nHouston
certificate_textstringThe certificate's text.A valid certificate file in Base64 PEM format.
 Click to view...

-----BEGIN CERTIFICATE-----
MIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ
c2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI
DAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy
MjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV
BAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P
Xx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW
voK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da
M3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC
+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6
PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj
UDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw
+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
A4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh
cDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw
FYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh
/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag
qz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa
Km6r7YmwfLN/YMZBHXSR58oOGP9W
-----END CERTIFICATE-----

ipstringThe host's IP address.A valid IP address.192.168.0.1
needs_sniBooleanWhether the website requires SNI to function.
  • 1 — Requires SNI.
  • 0 — Does not require SNI.
0
domainsstringThe domains that the certificate covers.A valid domain name or list of domain names.example.com
servernamestringThe server's hostname.A valid domain name.example.com
docrootstringThe document root of the domain that the certificate covers.A valid file path./home/username/public_html
is_primary_on_ipBooleanWhether the website is primary on the IP address.
  • 1 — Primary.
  • 0Not primary.
1
fqdnsstring

A list of every valid fully qualified domain name (FQDN) on the virtual host, which includes proxy subdomains.

Note:

We introduced this return in cPanel & WHM version 64.

A comma-separated list of any FQDN on the account's virtual host.www.example.com