Child pages
  • UAPI Functions - SSL::get_cn_name

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt
This function retrieves the best domain to use for SSL for a service.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titlecPanel or Webmail Session URL
Code Block
languagetext
https://hostname.example.com:2083/cpsess##########/execute/SSL/gen_cn_name?domain=example.com&service=cpanel

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink

Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieves the best domain to use for SSL for the cPanel service.
$SSL_get_cn_name = $cpanel->uapi(
    'SSL', 'get_cn_name',    array(
        'domain'          => 'example.com',
        'service'         => 'cpanel',
  )
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

Expand
titleLiveAPI Perl Module
Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieves the best domain to use for SSL for the cPanel service.
my $SSL_get_cn_name = $cpliveapi->uapi(
    'SSL', 'get_cn_name',    {
        'domain'          => 'example.com',
        'service'         => 'cpanel',
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

Expand
titlecPanel Template Toolkit
Code Block
languagexml
<!-- Retrieves the best domain to use for SSL for the cPanel service. -->
[% data = execute( 'SSL', 'get_cn_name', { domain => 'example.com', service => 'cpanel'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

Include Page
LIB:_TTLink
LIB:_TTLink

Expand
titleCommand Line
Code Block
languagetext
uapi --user=username SSL get_cn_name domain=example.com service=cpanel

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": {
    "is_self_signed": 1,
    "is_wild_card": 0,
    "ssldomain": "hostname.example.com",
    "ssldomain_matches_cert": 1,
    "cert_valid_not_after": "1394288638",
    "cert_match_method": "hostname"
  }
}

Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain name.

A valid domain name.

example.com

 

servicestring

Required

The service's name.

  • cpanel
  • ftp
  • imap
  • pop3
  • smtp
cpanel
add_mail_subdomainstringAny additional subdomains that are associated with the certificate.A valid string.mail

Returns

ReturnTypeDescriptionPossible valuesExample
is_self_signedBooleanWhether the certificate is self-signed.
  • 1 — Self-signed.
  • 0 — Not self-signed.
1
is_wild_cardBooleanWhether the certificate is a wildcard certificate.
  • 1 — Wildcard.
  • 0 — Not a wildcard.
0
ssldomainstringThe best domain to use to access the service.
  • A valid domain.
  • A valid username.
  • An email address.
hostname.example.com
ssldomain_matches_certBooleanWhether the certificate also covers the mail service.
  • 1 — Mail service.
  • 0 — No mail service.
1
cert_valid_not_afterstringThe certificate's expiration date.A date in Unix time format.1394288638
cert_match_methodstringThe method that the system used to match the certificate with the mail service.A valid string.hostname