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

 

Description

This function lists SSL-related items on a domain.

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.

 cPanel Template Toolkit

List keys:

<!-- List SSL-related items on the example.com domain. -->
[% data = execute( 'SSL', 'list_ssl_items', { domains => 'example.com', item => 'key'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

List CSRs:

<!-- List SSL-related items on the example.com domain. -->
[% data = execute( 'SSL', 'list_ssl_items', { domains => 'example.com', item => 'csr'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

List certificates:

<!-- List SSL-related items on the example.com domain. -->
[% data = execute( 'SSL', 'list_ssl_items', { domains => 'example.com', item => 'crt'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

 

Note:

For more information, read our Guide to Template Toolkit documentation. 

 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. 
  • We introduced this functionality in cPanel & WHM version 56.

 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