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

 

Description

This function lists the components of each SSL certificate on the server's virtual hosts.

Warning:

  • On most servers, this function returns a large amount of output. We strongly recommend that you filter and sort the output.
  • The following example uses the filter and sort options:
https://hostname.example.com:2087/cpsess##########/json-api/fetch_vhost_ssl_components?api.version=1&api.filter.a.field=servername&api.filter.a.arg0=servername.com&api.filter.a.type=eq&api.filter.enable=1&api.sort.enable=1&api.sort.a.field=servername

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/fetch_vhost_ssl_components?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/fetch_vhost_ssl_components?api.version=1
 Command Line
whmapi1 fetch_vhost_ssl_components

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
  "data": {
    "components": [
      {
        "servername": "example.com",
        "key_id": "e353a_5bc13_7ff85c8ae9750fbec0fbf7b30c1e0134",
        "certificate":
 "-----BEGIN 
CERTIFICATE-----\nMIID3TCCAsWgAwIBAgIFANfp2rUwDQYJKoZIhvcNAQEFBQAwgYYxFTATBgNVBAMM\nDGV4YW1wbGUxLmNvbTELMAkGA1UEBhMCVVMxKDAmBgkqhkiG9w0BCQEWGWxhdXJl\nbmNlLnNpbW9uQGNwYW5lbC5uZXQxFDASBgNVBAoMC2NQYW5lbCBJbmMuMQ4wDAYD\nVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjAeFw0xMzA4MTQxNjIzMDhaFw0x\nNDA4MTQxNjIzMDhaMIGGMRUwEwYDVQQDDAxleGFtcGxlMS5jb20xCzAJBgNVBAYT\nAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwubmV0MRQw\nEgYDVQQKDAtjUGFuZWwgSW5jLjEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv\ndXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDjU6olzIrQXTIl\nYR5EEMAnDBGy1G+IcF09F5ojECqyTuFnwakHC59VToO63huEJW4RxaDLKslrlvKO\ngCsRxyHXP7\/mHdmDmXSm\/OTheRXA+\/iFBW8YZWBBz3DbRgsiyrX9JQJJHkq58NLL\ncnSA4OvWLoOHCs2jG\/otRiXv2CI0+XKfNR6gL7FiYJwWVMEbXexGhTmju4MHOoX3\ni89XfNi3GFARRczNidetsLsYyHLnMDoV4sdaarMVx\/oJnkNRpPD\/Emwmk\/cdnyHZ\n95i5S7aJJ3CD\/qjcwBtq8mjQrYt6SB+KF50HY5zfMpDJNyOTenZ8QAqM5LHKGfCn\nEXCE1bwTAgMBAAGjUDBOMB0GA1UdDgQWBBR67\/hOWIfAZre2ibyF587wcJzGtjAf\nBgNVHSMEGDAWgBR67\/hOWIfAZre2ibyF587wcJzGtjAMBgNVHRMEBTADAQH\/MA0G\nCSqGSIb3DQEBBQUAA4IBAQCAaSmPEuZVRio0BqN4536pTkjpbezUrL3S3SD3ETuC\n0sbrCJxDLVejf7aWtpIKhL\/N0LcIvbJnjcW7DWocPEVpktCqlOFUTb5V3Cy3Qc6n\nyxrWSrZtbWZEeZyERYfYEhNR5JTvLXJTVNdOoqI1Ty2oqRDMF\/VQc9u8Iy46Syi3\nGfZLQAVVj9v9BwAS9ykXsxf5TZjNyl22C9OIR3gJhTYNUSu9jqUYbJ0LtTKT16Pg\nb9tBvR3YIEH4Cp+PtxgCRxCp6wSUKLpPVQ+KM+FxUbszt+G8KIM1I8OWgls\/EEQ6\nugr04bhDMRLGgLMypqkNOXCom3R6Zt0kh+FQ\/vTMzfDT\n-----END
 CERTIFICATE-----",
        "cabundle_id": null,
        "cabundle": null,
        "certificate_id": "example_com_e353a_5bc13_1408033388_9a1d40aff655f98fed7206e5af466065",
        "key":
 "-----BEGIN RSA PRIVATE 
KEY-----\nMIIEowIBAAKCAQEA41OqJcyK0F0yJWEeRBDAJwwR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69WeuDK9FNsNwnsLg\nITIca5ac3rcNhuuIn\/wkjFeg8BeUzYD0pw4fw6uCBuJgur2EQX93hYX0HHGsPsvJ\nFqz6ufheiFJbrTQ+OPFmNcwbAE2jyvrJo6aNwNjTuvLYNMzUroqffCzzsUGFOUk6\n\/uDXf8da0MDUHxAJKk+CPQKBgQDkJWpgYgu9ATkoMmrMrIphM5rVjixEmXxvKF2E\nu0tLiZwEoZAhxLwHlKTUjxrWa3KUB+6t3poWqqsHy\/L7G4iLPvgyX2htpLX+GYRs\nDwJOgBH0Ayf8tBXxZUeTyn0sI4vTuw8mEK1hP2+OaYuY\/BmoO7ZMhslH8Uhst5Ua\nz2tfRQKBgEqz133drotPqWdnDIrlrVklLVOgBHA9VXqA3AxczOoJojK92P7\/nRfb\nziQjdFMMnAQgdLajiz2uhr5H6rZMUttYtb6U7zsqLcGSk2WxwPS3OlGSLwz2xZW8\nRfp50juACvuE779rJQCLNbnuYcpkBZV\/fM\/8dGypDWZrKbafUmpL\n-----END
 RSA PRIVATE KEY-----"
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": "1",
    "command": "fetch_vhost_ssl_components"
  }
}
 Output (XML)
<result>
    <data>
        <components>
            <servername>example.com</servername>
            <key_id>e353a_5bc13_7ff85c8ae9750fbec0fbf7b30c1e0134</key_id>
            <certificate>
                -----BEGIN
 CERTIFICATE----- 
MIID3TCCAsWgAwIBAgIFANfp2rUwDQYJKoZIhvcNAQEFBQAwgYYxFTATBgNVBAMM 
DGV4YW1wbGUxLmNvbTELMAkGA1UEBhMCVVMxKDAmBgkqhkiG9w0BCQEWGWxhdXJl 
bmNlLnNpbW9uQGNwYW5lbC5uZXQxFDASBgNVBAoMC2NQYW5lbCBJbmMuMQ4wDAYD 
VQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjAeFw0xMzA4MTQxNjIzMDhaFw0x 
NDA4MTQxNjIzMDhaMIGGMRUwEwYDVQQDDAxleGFtcGxlMS5jb20xC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certificate>
            <cabundle_id/>
            <cabundle/>
            <certificate_id>
example_com_e353a_5bc13_1408033388_9a1d40aff655f98fed7206e5af466065
            </certificate_id>
            <key>
                -----BEGIN
 RSA PRIVATE KEY----- 
MIIEowIBAAKCAQEA41OqJcyK0F0yJWEeRBDAJwwRstRviHBdPReaIxAqsk7hZ8Gp 
BwufVU6Dut4bhCVuEcWgyyrJa5byjoArEcch1z+/5h3Zg5l0pvzk4XkVwPv4hQVv 
GGVgQc9w20YLIsq1/SUCSR5KufDSy3J0gODr1i6DhwrNoxv6LUYl79giNPlynzUe 
oC+xYmCcFlTBG13sRoU5o7uDBzqF94vPV3zYtxhQEUXMzYnXrbC7GMhy5zA6FeLH 
WmqzFcf6CZ5DUaTw/xJsJpP3HZ8h2feYuUu2iSdwg/6o3MAbavJo0K2Lekgfihed 
B2Oc3zKQyTcjk3p2fEAKjOSxyhnwpxFwhNW8EwIDAQABAoIBAC1MJ5RenK6GU461 
OnWvrMpbEk/DGvJiCYI56MHh39Al/a5SHZ9ExpwWCBO9XFhJqRQrgC3bucURkAWr 
LmnddzXQAyoUeppJgsAflnADU71fuBaxjYCb+sFCV6ep3mAxanAl5r2xJozEmwxl 
IyfnKbdFD3piQbWlxoUs/DQ9qhtJ1TcL8kiu/b9t0n2hEMwHQVdTyX7teWOgBSSn 
8l54mMlU0Co4EUVg8jS1y7+LL5Jw86Wlb0XsQhHAkA3++Bv7mNDOKVPAR/kkpk2X 
ynHTY5R5M74hETmvqpuoD8azOCL2gd+7Y1pzXDqnytjs05YsRy9BVin7bmPG8SHf 
k9cxnGkCgYEA/UtL5fP2GqEoOB54NnkuM0oCRIgI3y+beR3AM/3Z9et1eCWDsxGv 
P5PWU+Bkje+NxLcFXspy83DP50G0kcXWB7w7hRBsxxTayo92ouq59ebFv1zo//dX 
gtcvdTceOhq3vocuqdMCkmcQv5oCZMTj402OEDvEiXh8hkj/u7mZO5UCgYEA5cFa 
cZusoeacvdc2Bb2cR1WbMM5S8yzPM1alsYhuG9KuemSMpveUvGnBnZfhHkZzCUkf 
iDb6URnZ8mKfN+iJrRcu60iKlPut5/B2ufwrg1th8U7TBWO3CvTS+oZFLmW59fjy 
Qorf5n8wWlrAXrEbf4eG/8KoD2YdDfsE6S2x7wcCgYBFpEU69WeuDK9FNsNwnsLg 
ITIca5ac3rcNhuuIn/wkjFeg8BeUzYD0pw4fw6uCBuJgur2EQX93hYX0HHGsPsvJ 
Fqz6ufheiFJbrTQ+OPFmNcwbAE2jyvrJo6aNwNjTuvLYNMzUroqffCzzsUGFOUk6 
/uDXf8da0MDUHxAJKk+CPQKBgQDkJWpgYgu9ATkoMmrMrIphM5rVjixEmXxvKF2E 
u0tLiZwEoZAhxLwHlKTUjxrWa3KUB+6t3poWqqsHy/L7G4iLPvgyX2htpLX+GYRs 
DwJOgBH0Ayf8tBXxZUeTyn0sI4vTuw8mEK1hP2+OaYuY/BmoO7ZMhslH8Uhst5Ua 
z2tfRQKBgEqz133drotPqWdnDIrlrVklLVOgBHA9VXqA3AxczOoJojK92P7/nRfb 
ziQjdFMMnAQgdLajiz2uhr5H6rZMUttYtb6U7zsqLcGSk2WxwPS3OlGSLwz2xZW8 
Rfp50juACvuE779rJQCLNbnuYcpkBZV/fM/8dGypDWZrKbafUmpL -----END RSA 
PRIVATE KEY-----
            </key>
        </components>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>fetch_vhost_ssl_components</command>
    </metadata>
</result>

Note:

Use WHM's API Shell interface (Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
componentshashA hash of the certificate information.

This hash includes the servername, key_id, certificate, cabundle_id, cabundle, certificate_id, and key returns.

 

servername

string

The domain or domains that the certificate covers.

The function returns this value in the components hash.

A valid domain name.example.com

key_id

string

The ID of the certificate's key.

The function returns this value in the components hash.

A valid string.
 Click to view...

e353a_5bc13_7ff85c8ae9750fbec0fbf7b30c1e0134

certificate

string

The certificate's text.

The function returns this value in the components hash.

A valid certificate in Base64 PEM format. 
 Click to view...
-----BEGIN CERTIFICATE----- 
MIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD 
VQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD 
VQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l 
dDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH 
EwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU 
BgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ 
BgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu 
bmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV 
BAcTB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRO0AP 
N5XtjDqkEyJ6ctfYqUtt9yUXyRuCETFjW6opNLSmZSHeF6L2aZka646lhj02CFyl 
kzsNSxysN66tY+WZcTmvgPisJdQFpFvjroJZgDjYRV0QqokKdRy/5BU0+tHXoYpj 
9JOQlbvEWxiGR3R80sL1ma4AfSE6Gv8M/PULTadan51eHaikXqjOXdPJQKuWP3g9 
FnIuf38WRYwzGrre88qsZrpsMrADX5dotHWgqAf7Tap6xfA4CUAgQo9tldariuVi 
Bz+sRJ/Sjgxnhw1HYWGttBuBZFhMpdHpPnTJ7DIFMd/FN5gG/tah30SapWpo35Ux 
3BpJcdUjtazy82K5AgMBAAGjUDBOMB0GA1UdDgQWBBQAlv7/tALOYb7zAXbYG2+9 
AMI3xjAfBgNVHSMEGDAWgBQAlv7/tALOYb7zAXbYG2+9AMI3xjAMBgNVHRMEBTAD 
AQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a 
a9d+QG+QPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr 
HRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw 
caRtXn4uc+t6HYuW7yWesBauCWnJNiKbjN/F+uCTurN3QMAeWf3ZJtsfkAgk8dyq 
R/83a3kDtSPrpt+jX+qdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P/AAGc+ 
ZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a
-----END CERTIFICATE-----%0

cabundle_id

string

The ID of the certificate's CA bundle.

The function returns this value in the components hash.

A valid string or null.null

cabundle

string

The certificate's CA bundle.

The function returns this value in the  components  hash.

A valid CA bundle or null.

null

certificate_id

string

The certificate's ID.

The function returns this value in the  components  hash.

A valid string.
 Click to view...

example_com_e353a_5bc13_1408033388_9a1d40aff655f98fed7206e5af466065

 

 

key

string

The certificate's key.

The function returns this value in the components hash.

A valid private key in Base64 PEM format. 
 Click to view...
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAomhpdCKB+gPO5TaxKWqvWa7dGsaSnKkrdRtb4S6DQQM2EcW2Xevp1HGYZr5YK3h2SGQqhkeFG44xv\/eJCIIai8FCHV3ulWlzzt4W6akTHWET1q6bl\/aUq36OvMdsBCiZ5UkhI0+ZAEpCQWdUpBQFHxaxZuypaJbL1ITmAs\/k+x8=