We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • WHM API 1 Functions - fetchsslinfo
Skip to end of metadata
Go to start of metadata

Description


This function retrieves information about SSL certificates that you could install for a user. This function does not provide information about the currently installed certificates.

Examples 


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


Notes:

  • Unless otherwise noted, 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.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
	"metadata": {
		"reason": "OK",
		"result": 1,
		"version": 1,
		"command": "fetchsslinfo"
	},
	"data": {
		"key_origin": "example",
		"domain": "example.com",
		"user": "example",
		"cab": "",
		"key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEArfU3mqp3gGExGbfXy23sI/e2G8n2de/mPceSzxt82CACAGZb\nCH+IYSjIHR6YqYWSiZdhB6NIKQWbAjn8j4fncsDVSudZREAdpjxQIkwx4J7bYT19\nuYBI0yFyei/8A5gGXeQRYSQpUE3d1BkWxbOP49NO6LXMeXyeuvU848tkxL63wPce\nmk2hQHAGQpFD8x62oJpDceWBuScyLT/kNu5pXQYk1tc1f26GcapAVQjbWwRVTjFy\n+0QM3zx1PV3HkSEtehsNX9uteAWbzlAr+Vm3dpaUgkuz9YklIr7XnY87ceF+gemT\nH4l+Uxih6/ktq5eFkZhcIQbywEtrY88f1aWmBwIDAQABAoIBAD9rmDMOFPU7+d+r\nc8QZti7Cv6TP88e5h5JccTyKg/BzcudcabHmdP0fFh3vqq6bIPqCswBK2iMChSnB\npD9bx9jBTsG5KIVGbsjNUlW+u6xtngOMnIqFp4c5uXesiM9ynFecr21f9qPtT4Nl\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xY+v8jyOhTKvZTOjuuGKhDRcNNgn/kPIjZw3v37vY4o1pUPL\nP1YBw2Caa01HstzouaVZlw05Viwo2AHJE5u7zW+VcA4VR8WAD/2SqdyWZIo+chwd\nr3hWlRyHephLCBhOLb1wPk3E+mOIyryXjLpGdVnWewMSEY8AGvv7IORkO5ufCz/c\n5UlG1r1+l5AhnFQPGoREI49hXVAETVInW9Uk\n-----END CERTIFICATE-----",
		"searched_users": ["root", "example"],
		"ip": "192.168.0.20",
		"crt_origin": "example"
	}
}
 Output (XML)
<result>
    <data>
        <ip>192.168.0.20</ip>
        <searched_users>root</searched_users>
        <searched_users>example</searched_users>
        <crt_origin>root</crt_origin>
        <key>
            -----BEGIN
 RSA PRIVATE KEY----- 
MIIEpAIBAAKCAQEA0TtADzeV7Yw6pBMienLX2KlLbfclF8kbghExY1uqKTS0pmUh 
3hei9mmZGuuOpYY9NghcpZM7DUscrDeurWPlmXE5r4D4rCXUBaRb466CWYA42EVd 
EKqJCnUcv+QVNPrR16GKY/STkJW7xFsYhkd0fNLC9ZmuAH0hOhr/DPz1C02nWp+d 
Xh2opF6ozl3TyUCrlj94PRZyLn9/FkWMMxq63vPKrGa6bDKwA1+XaLR1oKgH+02q 
esXwOAlAIEKPbZXWq4rlYgc/rESf0o4MZ4cNR2FhrbQbgWRYTKXR6T50yewyBTHf 
xTeYBv7Wod9EmqVqaN+VMdwaSXHVI7Ws8vNiuQIDAQABAoIBAQDNxUyh6pPbtG6z 
kFH3RNy8qvqQ4l+rfdA84bXFto+pyLjlcE6Xgn11g7Lcg8+dQGEQs7aR7DNGRpmj 
UXvL8JQMjQsjbF6jxuw2xEbOq4BsjyrYn5cAXgc6rqSgn6qvmQEo5SkaVp2Ns4Sf 
fsumu713STwNmJ9EwcscvxIY7un7uxJJab7TFePIm3sjvh00Pr/qGIzXs3JrpfeB 
wMEmrlmatA09aSek/MqPQaCVrJkTnBG0rkhJeK5aucrA6a5OrKGKEbTAzcEuO5u0 
Rx+52S3SIb0ItGja6y9NmGjM0ofjE6svGxKHj6hXKw62SYnCZjmMsHh/7QDPSFxu 
hkndoZ+RAoGBAPOe8l1Mt+xwMJ64ME1dIzSmQpAcq7lRG+pFrCbx9bbDUegCfZML 
74S/ar+o8rSRUtf/kBzwWwKJsGJ8vvssA+sHBJwhD76iorN/DmH2LgXGui1N5QdO 
IGlzP/F1Zer+/bVBN8gfG874Y5oyvOqobvd9XIlT+IfIWEisjEBt8RItAoGBANvc 
9ga05rf+4UqpIfWL3NFKYNXvND1BXiav/S15vO5/Jz/p8KH1tPQUcqw6VyhbHaOs 
afoBhdSqG8nFxAvCxpU3MokgrGE+I0GHDfFWSqoQDEXF+NVHwZQq/loZO+BUao5f 
sZdMfny1zCJquXIZdHpiLAN9DGNwtgvO/0ngiQY9AoGBAIcWN+YsSEA+5XbdQ0ti 
vcbP+lDW1RHpO8Vn5NGjkVBKdfxkhSUolSPS0Gp+UDZ37qv+9fZWAOEjYD78VRoJ 
ihKkzZWVb5mRrQ5DAcKoM1TYoRvF+Z1XYPmYAnjtVBo+UohTJY8+ULkvWmuCfubP 
htiNFua/PSxtlyaVJyAC1o3xAoGAHueEPZUYCSzuhgwYFee+9jw6OFgTQ7j4fv+l 
2sqN4AhHgBhmFp3u/ZASPltE/Qsxs1v82YN1SFtQ5J/D2tNaDodftx68nD6bvg45 
y36RqC3xS610OKaJc0ZH0mpRnErBX5nb4KSD8wuq0fumbX9efAVoomTlZOTm8en6 
wGurVxECgYBWXLcLmjlOInirL0p5wDL2Qc5qWoOaLVqLxuzz+ly1uod7ruRlxZao 
At7CFatFz2XVFeAFhoRdKVdWh5QGE+QtZL6V9nZHgUoCfwMl3Xt2vpGtuYjuobu7 
rwGtjYc+LkBtubG9M/NvvBMtaTShti2X4FWcMBl7du2sDwHVFfs1UA== -----END RSA 
PRIVATE KEY-----
        </key>
        <key_origin>example</key_origin>
        <domain>example.com</domain>
        <user>example</user>
        <crt>
            -----BEGIN
 CERTIFICATE----- 
MIIEEzCCAvugA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AA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a 
a9d+QG+QPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr 
HRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw 
caRtXn4uc+t6HYuW7yWesBauCWnJNiKbjN/F+uCTurN3QMAeWf3ZJtsfkAgk8dyq 
R/83a3kDtSPrpt+jX+qdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P/AAGc+ 
ZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a -----END 
CERTIFICATE-----%0
        </crt>
        <cab/>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>fetchsslinfo</command>
    </metadata>
</result>


Note:

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

   

Parameters

You must include one of the following two parameters.

ParameterTypeDescriptionPossible valuesExample
domainstring

The domain's name.

A valid domain name.example.com
crtdatastring

The certificate's text.

A valid SSL certificate.
 Click to view...
-----BEGIN CERTIFICATE----- \r\n
MIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD\r\n 
VQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD\r\n 
VQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l\r\n 
dDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH\r\n 
EwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU\r\n 
BgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ\r\n 
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I7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a\r\n
                    
-----END CERTIFICATE-----%0

Returns

ParameterTypeDescriptionPossible valuesExample
ipstring

The certificate's IP address.

A valid IP address.192.168.0.20
searched_usersarrayThe users that the system searched to find certificate information.A list of valid usernames."root, example
crt_originstringThe certificate's creator.A valid username.root
keystringThe certificate's key.A valid private key in Base64 PEM format.
 Click to view...
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAomhpdCKB+gPO5TaxKWqvWa7dGsaSnKkrdRtb4S6DQQM2EcW2Xevp1HGYZr5YK3h2SGQqhkeFG44xv\/eJCIIai8FCHV3ulWlzzt4W6akTHWET1q6bl\/aUq36OvMdsBCiZ5UkhI0+ZAEpCQWdUpBQFHxaxZuypaJbL1ITmAs\/k+x8=
key_originstringThe key's creator.A valid username.example
domainstring

The domain name on the certificate.

A valid domain name.example.com
userstringThe certificate's owner.A valid username.example
crtstring

The certificate's text.

A valid SSL certificate in Base64 PEM format.
 Click to view...
-----BEGIN CERTIFICATE----- 
MIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD 
VQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD 
VQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l 
dDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH 
EwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU 
BgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ 
BgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu 
bmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOM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