Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cPanel uapi to deploy a single certificate for multiple domains

Discussion in 'cPanel Developers' started by glpanel, Jun 24, 2018.

Tags:
  1. glpanel

    glpanel Member

    Joined:
    Jun 24, 2018
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Italy
    cPanel Access Level:
    Website Owner
    Hello,

    I want to use cPanel uapi to deploy a single certificate for multiple domains and subdomains.

    If possible I’d like to know If with a single uapi command I can:

    1) deploy a single certificate containing a domain and two subdomains (eg. example.com www.example.com cp.example.com or a wildcard *.example.com)

    2) deploy a single certificate containing multiple domains (eg. aa.com bb.com cc.com dd.com)

    I hope someone can suggest something.

    Thank You.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,928
    Likes Received:
    1,819
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @glpanel,

    The following UAPI function is available for installing a SSL certificate:

    UAPI Functions - SSL::install_ssl - Developer Documentation - cPanel Documentation

    You'd need to install it for each domain name individually (using multiple UAPI commands) just as you would via the cPanel UI. Have you considered using the AutoSSL feature instead? It will automatically install free signed SSL certificates for individual domain names and subdomains that are added to the cPanel account.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. glpanel

    glpanel Member

    Joined:
    Jun 24, 2018
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Italy
    cPanel Access Level:
    Website Owner
    Hi Michael, thank you for your reply.

    "You'd need to install it for each domain name individually" means that to install the certificate of example N°1 I only need a single uapi command, while for example N°2 I must generate four certificates for each domain and install them with four uapi commands ?

    As for AutoSSL, I understand that it is a sort of user interface to automate the installation of certificates issued by Let's Encrypt or other certificate authority, in this case my hosting provider has not enabled this cPanel module.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,928
    Likes Received:
    1,819
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @glpanel,

    It depends on the type of certificate you are installing. For instance, is it a standard SSL certificate that covers a single domain name, a wildcard SSL certificate, or a multi-domain (UCC) certificate?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. glpanel

    glpanel Member

    Joined:
    Jun 24, 2018
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Italy
    cPanel Access Level:
    Website Owner
    I want to install a standard certificate that covers a domain and subdomain like example.com www.example.com
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,928
    Likes Received:
    1,819
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    In that case, yes, a single UAPI command is all you'd need. EX:

    Code:
    uapi SSL install_ssl domain=example.com cert=THECERTIFICATETEXT key=THEKEYTEXT cabundle=THECABUNDLETEXT
    
    You wouldn't need to run an additional command for the "www" subdomain, as it's included by default as part of the installation.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice