Results 1 to 5 of 5

Thread: Install wildcard ssl using XML API class

  1. #1
    Member
    Join Date
    Feb 2008
    Location
    Atlanta, GA
    Posts
    94
    cPanel/WHM Access Level

    DataCenter Provider

    Default Install wildcard ssl using XML API class

    I have been trying to install a wildcard ssl cert using the php api class but having issues.
    I can get the cert to install but apache ends up crashing and I have to terminate the user account in order to get the server back up.

    How it works normaly in WHM in SSL setup

    Enter crt
    Enter key
    Enter ca bundle

    WHM reads the cert as belonging to the base domain and inputs the user, ip, base domain into the user, ip, domain box. I change these to the correct values and then install cert, all is good.

    In the API docs the User and IP are not listed as param options. I tried to include them in the array anyway but still had the same result.
    Code:
    $installssl = $xmlapi->api2_query($user, "SSL", "installssl", array(cabundle => $cabundle, crt => $crt, domain => $domain, key => $key, ip => $ip, user=> $user));
    I have tried the above with and without ip and user and it will install but apache crashes. Anyone have any idea if I can get this to work?
    Last edited by tomdchi; 02-21-2010 at 03:10 AM.

  2. #2
    Member
    Join Date
    Feb 2008
    Location
    Atlanta, GA
    Posts
    94
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    I got it to install and it works ok. But now when I install the cert a process is started that doesn't shutdown and runs up the cpu usage to almost 100%. I have to manually kill the process.
    the cpu usage list will show the command as:

    whostmgrd - serving *ip of site cert was installed*

    LOL, I finaly get the cert to install and to work but now the server is going to crash anyway because of another process. Just my luck.
    Anyone have any idea on how to prevent this?

    The scrip I am running:

    Code:
    <?php  
    
    require ('xmlapi.php');
    require ("ssl.php"); //holds the ssl cert, key, and cabundle
       
    $user = "sub";  
    $domain = "subdomain.domain.com";
    
    $xmlapi = new xmlapi($domain);  
    $xmlapi->password_auth("root","root_pass");  
    $xmlapi->set_debug(1); 
    
    $installssl = $xmlapi->api2_query($user, "SSL", "installssl", array(cabundle => $cabundle, crt => $crt, domain => $domain, key => $key));  
    
    ?>

    Doing a trace on the process shows this over and over:
    Code:
    write(12, "\27\3\1\0000\34&\360\223N\25\"v\2757J\367`\265mb\353\347 \222\t\232\6\273\302\206\231"..., 53) = -1 EPIPE (Broken pipe)
    --- SIGPIPE (Broken pipe) @ 0 (0) ---
    kill(13824, SIGKILL)                    = -1 EPERM (Operation not permitted)
    rt_sigreturn(0x11895410)                = -1 EPIPE (Broken pipe)
    Last edited by tomdchi; 02-21-2010 at 03:47 PM.

  3. #3
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    By any chance are you connecting to the same box that is serving the page? If so, then this is the cause of your problem as installing an SSL cert forces an apache restart.
    Matt Dees

  4. #4
    Member
    Join Date
    Feb 2008
    Location
    Atlanta, GA
    Posts
    94
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    yes it is on the same box. I have another server that I can use to initiate this operation. I will give that a try

  5. #5
    Member
    Join Date
    Feb 2008
    Location
    Atlanta, GA
    Posts
    94
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    That did it. I moved my scripts over to a different server and everything worked fine!

    Thanks Matt!

    BTW the php class rocks!

Similar Threads

  1. XML API PHP Class version 1.0
    By MattDees in forum cPanel Developers
    Replies: 107
    Last Post: 02-24-2011, 08:38 AM
  2. XML API class works with a WHM cPanel reseller account?
    By bcosmo in forum cPanel Developers
    Replies: 1
    Last Post: 03-17-2010, 09:33 AM
  3. WHM XML API ready to use class
    By arash_hemmat in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 07-18-2008, 05:03 AM
  4. How do I install a wildcard SSL?
    By tfittsy in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 04-12-2007, 12:02 PM