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!

Issue and install Let's Encrypt certificate with API

Discussion in 'cPanel Developers' started by fred_inovagora, Jan 7, 2019.

  1. fred_inovagora

    fred_inovagora Member

    Joined:
    Dec 21, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    France
    cPanel Access Level:
    Reseller Owner
    Hi,

    I'm trying to issue/install a Let's Encrypt certificate for a single FQDN entirely with the cPanel UAPI and/or the cPanel API2.
    Could you point me in the right direction ? (if this is possible)

    Thanks a lot
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    508
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hello,


    Since AutoSSL is installed per account rather than per domain, so long as you have Let's Encrypt selected as your provider you can run the following to check per account:

    WHM API 1 Functions - start_autossl_check_for_one_user - Developer Documentation - cPanel Documentation

    This will check, provision and install the certificate for a cPanel user, if there are multiple domains on the account and you would not like for them to have an SSL you can exclude them with UAPI Functions - SSL::add_autossl_excluded_domains - Developer Documentation - cPanel Documentation
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. fred_inovagora

    fred_inovagora Member

    Joined:
    Dec 21, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    France
    cPanel Access Level:
    Reseller Owner
    Thanks Lauren ! I'm going to give it a try.
     
    cPanelLauren likes this.
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    508
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. fred_inovagora

    fred_inovagora Member

    Joined:
    Dec 21, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    France
    cPanel Access Level:
    Reseller Owner
    Hi @cPanelLauren

    Sadly this didn't work as I d'ont have AutoSSL enabled on my account (and my hosting provider will not enable it).

    I'm trying to find if there are specific API endpoints added by the cPanel Let's Encrypt addon. (cPanel API, not WHM API)
     
  6. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    508
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    HI @fred_inovagora

    I see, if your provider has disabled this (whether or not you're using the Comodo/Sectigo or Let's Encrypt providers) You will not be able to use AutoSSL at all.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. fred_inovagora

    fred_inovagora Member

    Joined:
    Dec 21, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    France
    cPanel Access Level:
    Reseller Owner
    I found a partial solution, using a modified version of github.com/analogic/lescript
    I then use the cPanel API to place the challenge file and to install the generated certificate, everyting remotely.
    It works fine.
    The only problem is that it's considered in cPanel as classic SSL certificate and not taken into account in FleetSSL plugin, so there will be no automatic renewal on the cPanel side.
     
    #7 fred_inovagora, Jan 18, 2019
    Last edited by a moderator: Jan 18, 2019
  8. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    508
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Fleet SSL is a separate 3rd party plugin as well and completely unrelated to cPanel. I am glad to hear you found a solution that worked for you though.
     
    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