Child pages
  • UAPI Functions - SSL::list_ssl_items
Skip to end of metadata
Go to start of metadata

Description

This function lists SSL-related items on a domain.

Important:

In cPanel & WHM version 84 and later, when you disable the CalendarContact, MailReceiveWebDiskWebmail, and WebServer roles, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/SSL/list_ssl_items?domains=example.com%7Cexample1.com%7Cexample2.com&items=key%7Ccrt%7Ccsr


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class

List keys:

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List SSL-related items on the example.com domain.
$SSL_list_ssl_items = $cpanel->uapi(
    'SSL', 'list_ssl_items',    array(
        'domains'          => 'example.com',
        'items'            => 'key',
 )
);

List CSRs:

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List SSL-related items on the example.com domain.
$SSL_list_ssl_items = $cpanel->uapi(
    'SSL', 'list_ssl_items',    array(
        'domains'          => 'example.com',
        'items'            => 'csr',
 )
);

List certificates:

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List SSL-related items on the example.com domain.
$SSL_list_ssl_items = $cpanel->uapi(
    'SSL', 'list_ssl_items',    array(
        'domains'          => 'example.com',
        'items'            => 'crt',
 )
);


Note:

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

 LiveAPI Perl Module

List keys:

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List SSL-related items on the example.com domain.
my $SSL_list_ssl_items = $cpliveapi->uapi(
    'SSL', 'list_ssl_items',    {
        'domains'          => 'example.com',
        'items'            => 'key',
    }
);

List CSRs:

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List SSL-related items on the example.com domain.
my $SSL_list_ssl_items = $cpliveapi->uapi(
    'SSL', 'list_ssl_items',    {
        'domains'          => 'example.com',
        'items'            => 'csr',
    }
);

List certificates:

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List SSL-related items on the example.com domain.
my $SSL_list_ssl_items = $cpliveapi->uapi(
    'SSL', 'list_ssl_items',    {
        'domains'          => 'example.com',
        'items'            => 'crt',
    }
);


Note:

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

 Command Line
uapi --user=username SSL list_ssl_items domains=example.com%7Cexample1.com%7Cexample2.com items=key%7Ccrt%7Ccsr


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)

List keys:

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "key",
      "host": "example.com"
    }
  ]
}

List CSRs:

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "csr",
      "host": "example.com"
    }
  ]
}

List certificates:

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "crt",
      "host": "example.com"
    }
  ]
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domainsstring

The domain name or names.

A valid domain or pipe-separated list of domains.

Note:

To retrieve multiple domains, separate them with the pipe (|) character.

example.com
itemstring

The SSL item type or types.

This parameter defaults to key.

  • key
  • csr
  • crt

Note:

To retrieve multiple types, separate them with the pipe (|) character.

key

Returns

ReturnTypeDescriptionPossible valuesExample
idstringThe certificate's ID.A valid string.
 Click to view...
example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff
typestringThe type of SSL item.
  • key
  • csr
  • crt
key
hoststringThe hostname.A valid hostname.example.com