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

Description

This function uploads an SSL key to the server.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Examples 


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$ssl_key = $cpanel->api1('SSL','uploadkey', array('KEY','example.com','TestKey') ); // Call the function.

Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $ssl_key = $cpliveapi->api1('SSL','uploadkey', ['KEY','example.com','TestKey'] ); # Call the function.

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)

Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="SSL::uploadkey( $FORM('key','host','file') )">
 Command Line
cpapi1 --user=username SSL uploadkey KEY example.com TestKey

Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (plaintext)
example.com (auto-detected)

Parameters

ParameterTypeDescriptionPossible valuesExample
key

string

The SSL key to upload through the HTTP-POST method.

Note:

You must include either the key or the file parameter.

The full contents of the SSL key file.(The SSL key file.)
hoststring

Required

The hostname for which to upload the SSL key.

A valid domain name.example.com
filestring

The full directory path to the SSL key file on the server.

Note:

You must include either the key or the file parameter.

A valid directory path.~/ssl/private/TestKey

Returns

This function returns a confirmation message. The system uploads the SSL key file to the ~/ssl/private directory.