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

 

Description

This function retrieves certificate information.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/fetchsslinfo?domain=example.com
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/fetchsslinfo?domain=example.com
 Command Line
whmapi0 fetchsslinfo domain=example.com

Notes:

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

 Output (JSON)
{
   "sslinfo":[
      {
         "ip":"192.168.1.20",
         "status":1,
         "statusmsg":"ok",
         "crt":"-----BEGIN CERTIFICATE-----
         gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z
         2A04vg7axd93FBUEMXqJCgb/cSV88Gu
        .............
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z
        2A04vg7axd93FBUEMXqJCgb/cSV88Gu\n
         -----END CERTIFICATE-----\n",
         "domain":"example.com",
         "user":"example",
         "key":"-----BEGIN RSA PRIVATE KEY-----
         gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z
         2A04vg7axd93FBUEMXqJCgb/cSV88Gu
        .............
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z
        2A04vg7axd93FBUEMXqJCgb/cSV88Gu\n
         -----END RSA PRIVATE KEY-----\n",
         "cab":"-----BEGIN CERTIFICATE-----
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z2
         A04vg7axd93FBUEMXqJCgb/cSV88Gu
        .......
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z2
         A04vg7axd93FBUEMXqJCgb/cSV88Gu
        -----END CERTIFICATE-----\n"
      }
   ]
}
 Output (XML)
<fetchsslinfo>
 <sslinfo>
        <key>-----BEGIN RSA PRIVATE KEY-----
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z
         2A04vg7axd93FBUEMXqJCgb/cSV88Gu
        .............
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z
         2A04vg7axd93FBUEMXqJCgb/cSV88Gu
        -----END RSA PRIVATE KEY-----
        </key>
        <cab>-----BEGIN CERTIFICATE-----
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z2
         A04vg7axd93FBUEMXqJCgb/cSV88Gu
        .......
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z2
         A04vg7axd93FBUEMXqJCgb/cSV88Gu
        -----END CERTIFICATE-----
        </cab>
        <crt>-----BEGIN CERTIFICATE-----
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z2
         A04vg7axd93FBUEMXqJCgb/cSV88Gu
        ........
        gCJZqVg1ozhK1LZanRtlDm2EFA1xOjs5Z2
         A04vg7axd93FBUEMXqJCgb/cSV88Gu
        -----END CERTIFICATE-----
        </crt>
            <domain>example.com</domain>
            <ip>192.168.1.20</ip>
            <status>1</status>
            <statusmsg>ok</statusmsg>
            <user>example</user>
    </sslinfo>
</fetchsslinfo>

   

Parameters

Note:

You must include either the domain or the crtdata parameter. 

ParameterTypeDescriptionPossible valuesExample
domainstring

The domain's name.

A valid domain name.example.com
crtdatastring

The certificate's text.

A certificate file in Base64 PEM format.
 Click to view...
-----BEGIN CERTIFICATE-----\r\n 
MIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD\r\n 
VQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD\r\n 
VQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l\r\n 
dDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH\r\n 
EwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU\r\n 
BgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAs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P/AAGc+\r\n 
ZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a\r\n
                    
-----END CERTIFICATE-----%0

Returns

ParameterTypeDescriptionPossible valuesExample
fetchsslinfo
hashA hash of the function's results.This hash includes the sslinfo hash. 

sslinfo

hashA hash of SSL information.This hash includes the ip, searched_users, crt_origin, key, key_origin, domain, user, crt, and cab returns. 

ip

string

The certificate's IP address.

The function returns this value in the sslinfo hash.

A valid IP address.192.168.0.20

searched_users

hash

A hash of the users that the system searched to find certificate information.

The function returns this value in the sslinfo hash.

A hash of valid usernames.root

crt_origin

string

The certificate's creator.

The function returns this value in the sslinfo hash.

A valid username.example

key

string

The certificate's key.

The function returns this value in the sslinfo hash.

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

key_origin

string

The key's creator.

The function returns this value in the sslinfo hash.

A valid username.example

domain

string

The domain's name.

The function returns this value in the sslinfo hash.

A valid domain name.example.com

user

string

The certificate's owner.

The function returns this value in the sslinfo hash.

A valid username.example

crt

string

The certificate's text.

The function returns this value in the sslinfo hash.

A certificate file in Base64 PEM format.
 Click to view...
-----BEGIN CERTIFICATE----- 
MIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD 
VQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD 
VQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l 
dDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAM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Wf3ZJtsfkAgk8dyq 
R/83a3kDtSPrpt+jX+qdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P/AAGc+ 
ZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a
-----END CERTIFICATE-----%0

cab

string

The certificate's CA bundle.

The function returns this value in the sslinfo hash.

A bundle file in Base64 PEM format.
 Click to view...
-----BEGIN CERTIFICATE-----
MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD
VQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv
b3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV
UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU
cnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyv
RLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4M
ypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/5
1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz
dcZfHeFhVYAA1IFLezEPI2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl
IjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9Apy
bW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY
-----END CERTIFICATE-----