The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Manage Service SSL Certificates via Command Line

Discussion in 'General Discussion' started by Loth, Jan 22, 2016.

  1. Loth

    Loth Member

    Joined:
    Oct 28, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AZ
    cPanel Access Level:
    DataCenter Provider
    Is it currently possible to install Service SSL certificates via the command line? I need to do this on a start-up script.
     
  2. Loth

    Loth Member

    Joined:
    Oct 28, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AZ
    cPanel Access Level:
    DataCenter Provider
    Hello, I am getting the following error when I try out the CLI API

    root@localhost [~]# whmapi1 accountsummary user=root
    Undefined subroutine &Encode::define_alias called at /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/XML/SAX/PurePerl/UnicodeExt.pm line 15.
    Compilation failed in require at /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/XML/SAX/PurePerl.pm line 27.
    Compilation failed in require at (eval 1) line 1.

    I've tried to install it via /scripts/perlinstaller XML::SAX::PurePerl::UnicodeExt however it seems its not found, XML::SAX is installed and updated.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Which version of cPanel is installed on this system? Also, are you able to reproduce the issue with a valid username (root is not a cPanel account).

    Thank you.
     
  4. Loth

    Loth Member

    Joined:
    Oct 28, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AZ
    cPanel Access Level:
    DataCenter Provider
    Hello, It seems it works with root after its updated and running, however I am getting an error with my certificate. What format does it need to be input as?

    root@cpanel-test [~]# whmapi1 install_service_ssl_certificate service=ftp crt="-----BEGIN CERTIFICATE-----\n MIIFZzCCBE+g...."

    metadata:
    command: install_service_ssl_certificate
    reason: "Invalid certificate passed to verifysslcert (missing BEGIN CERTIFICATE)\n"
    result: 0
    version: 1

    Secondly, can multiple services be input or only one at a time?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Please install the certificate on one service at a time. There's actually a script on the following thread you can utilize:

    [How-To] Installing SSL from Let's Encrypt

    Note that it's for a different purpose, but the installation script should work after you modify it for a service SSL installation.

    Thank you.
     
Loading...

Share This Page