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

 

Description

This function installs an SSL certificate.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/fetchsslinfo?domain=example.com&crt=CERTIFICATETEXT&key=KEYTEXT&cab=CABUNDLETEXT&ip=192.168.0.20?user=username
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/fetchsslinfo?domain=example.com&crt=CERTIFICATETEXT&key=KEYTEXT&cab=CABUNDLETEXT&ip=192.168.0.20?user=username
 Command Line
whmapi0 fetchsslinfo domain=example.com crt=CERTIFICATETEXT key=KEYTEXT cab=CABUNDLETEXT ip=192.168.0.20 user=username

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)
{
   "result":[
      {
         "status":1,
         "statusmsg":"Certificate successfully installed  
          Finished SSL Install Process for example.com (www.example.com).",
         "rawout":"Certificate verification passed<br /> <br />
          The Certificate for the domain example.com was installed on the IP 192.168.0.20.
          </html><br><b>Finished SSL Install Process for example.com      
         (www.example.com).</b>"
      }
   ]
}

 Output (XML)
<installssl>
     <rawout>Certificate verification passed<br /> <br />
      The Certificate for the domain example.com was installed on the IP 192.168.0.20.
     </html><br><b>Finished SSL Install Process for example.com      
     (www.example.com).</b></rawout>
      <status>1</status>
      <statusmsg>Certificate successfully installed
      Finished SSL Install Process for example.com (www.example.com).</statusmsg>
</installssl>

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The user's username.

A valid username.username
domainstring

Required

The domain's name.

A valid domain name.example.com
crtstring

Required

The certificate's text.

A valid SSL certificate.
 Click to view...
-----BEGIN CERTIFICATE-----\r\n 
MIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD\r\n 
VQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD\r\n 
VQQGEw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EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr\r\n 
HRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw\r\n 
caRtXn4uc+t6HYuW7yWesBauCWnJNiKbjN/F+uCTurN3QMAeWf3ZJtsfkAgk8dyq\r\n 
R/83a3kDtSPrpt+jX+qdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P/AAGc+\r\n 
ZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a\r\n
                    
-----END CERTIFICATE-----%0
keystring

Required

The certificate's key.

A valid private key.
 Click to view...
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAomhpdCKB+gPO5TaxKWqvWa7dGsaSnKkrdRtb4S6DQQM2EcW2Xevp1HGYZr5YK3h2SGQqhkeFG44xv\/eJCIIai8FCHV3ulWlzzt4W6akTHWET1q6bl\/aUq36OvMdsBCiZ5UkhI0+ZAEpCQWdUpBQFHxaxZuypaJbL1ITmAs\/k+x8=
cabstringThe certificate's CA bundle.A valid CA bundle.
 Click to view...
-----BEGIN CERTIFICATE-----\r\n
MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD\r\n
VQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv\r\n
b3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV\r\n
UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU\r\n
cnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyv\r\n
RLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4M\r\n
ypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/5\r\n
1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz\r\n
dcZfHeFhVYAA1IFLezEPI2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl\r\n
IjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9Apy\r\n
bW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY\r\n
-----END CERTIFICATE-----
ipstring

Required

The certificate's IP address.

A valid IP address.192.168.0.20

Returns

ReturnTypeDescriptionPossible valuesExample
result
array of hashesAn array of hashes of the function's results.The hash includes the rawout, status, and statusmsg returns. 

rawout

string

The function's raw output.

The function returns this value in the result hash.

A valid string in HTML format.
 Click to view...

Certificate verification passed<br /> <br />

           The Certificate for the domain example.com was installed on the IP 192.168.0.20.
           </html><br><b>Finished SSL Install Process for example.com     
          (www.example.com).</b>

status

Boolean

Whether the function was successful.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

The function call's status message.

The function returns this value in the result hash.

A valid string.