Skip to main content

API function remove_autossl_excluded_domains and wildcard

Comments

7 comments

  • cPRex Jurassic Moderator

    Hey there!  I've reached out to the SSL team about this and I'm hoping to have an update tomorrow I can share!

    0
  • Vinnie Murdico

    Awesome -- Thanks so much!

    0
  • cPRex Jurassic Moderator

    Unfortunately I'm not going to have any updates today - I'll post as soon as I know more.

    0
  • Vinnie Murdico

    No worries -- thanks for the update.

    0
  • cPRex Jurassic Moderator

    It is my understanding that yes, you need to specify each domain and subdomain you want to exclude.  You can also do this at the root level with this API call:

    https://api.docs.cpanel.net/specifications/whm.openapi/auto-generated-certificates/add_autossl_user_excluded_domains

    Is that what you were looking to find out?  There isn't going to be an API call for the panel.ini file as far as I am aware.

    0
  • Vinnie Murdico

    Thanks.  Actually, it seems cPanel now automatically excludes all domains by default for new accounts, so I was wanting to *remove excluded domains* using (remove_autossl_excluded_domains), whereas the linked API function from your previous reply seems to be related to *adding excluded domains* for AutoSSL.  But you have still answered my question by confirming that I do need to specify the individual domains to be removed from the exclude list after creating a new account.

    For future reference for those wondering about the process I used when creating a new account, I ended up doing the following steps in my new account creation script, rather than relying on panel.ini being there (but that seems to work fine as well and is much easier).  Anyway, here are these steps in order, and it seems to work in the absence of panel.ini.  This is just pseudocode with the cPanel API functions listed:

    createacct?username=$user&plan=$plan...  (tell cPanel to create the account)
    add_override_features_for_user?api.version=1&user=$user&features=%7B%22autossl%22%3A1%7D"
    remove_autossl_excluded_domains?domains=$domain,$mailsubdomain,$webmailsubdomain,$cpanelsubdomain,$autodiscoverysubdomain
    start_autossl_check (for this user account only)

    These steps in this order seem to work, and all the specified subdomains (mail., cpanel., webmail., etc.) are secured by the resulting SSL certificate that's generated by AutoSSL.  Note, in my code I added a short (few seconds "sleep") command between steps to ensure cPanel has time to complete them.  I have a 90s sleep after start_autossl_check to allow LetsEncrypt to add the certificate before I continue notifying the customer and providing an https link to their site in the email. 60s was hit or miss in some tests, so I just increased it to 90s and that seems to have been reliable.

    Hopefully this helps someone in the future...  :)  Thanks again for checking into this for me!

     

    0
  • cPRex Jurassic Moderator

    Nice - I'm glad you found a good workaround!

    0

Please sign in to leave a comment.