Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Install SSL Certificate — installssl

This function installs an SSL certificate.

Calling Functions

Using the XML API

To use the XML API to perform the installssl function from within your custom script:

  • Append the /xml-api/installssl function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/installssl

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the installssl function from within your custom script:

  • Append the /json-api/installssl function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/installssl

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The installssl function takes the following required variables:
  • user — The username of the domain owner
  • domain — Domain with which the SSL certificate is associated.
  • cert — Contents of the SSL certificate.
  • key — Contents of the key.
  • cab — Contents of the Certificate Authority Bundle.
  • ip — IP address associated with the certificate.

Output

Show Hide

  • installssl — Root-level XML tag for the output of the installssl function.
    • rawout — Raw output of the installssl function.
    • status — Result of the installation request.
      • 1 — success.
      • 0 — failure.
    • statusmsg — Information about the status of the request.

Examples

XML API

Show Hide

Calling https://example.com:2087/xml-api/installssl?user=username&domain=example.com&cert=certificate_data&key=key_data &cab=certificate_authority_bundle&ip=192.168.0.1 in WebHost Manager will produce output similar to:

<installssl>
     <rawout>Certificate verification passed<br /> <br />
      The Certificate for the domain example.com was installed on the IP 127.0.0.1.
     </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>

JSON API

Show Hide

Calling https://example.com:2087/json-api/installssl?user=username&domain=example.com&cert=certificate_data&key=key_data &cab=certificate_authority_bundle&ip=192.168.0.1 in WebHost Manager will produce output similar to:

{
   "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 127.0.0.1.
          </html><br><b>Finished SSL Install Process for example.com      
         (www.example.com).</b>"
      }
   ]
}

Topic revision: r6 - 27 May 2010 - 16:24:28 - Main.JustinSchaefer