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.

XMLAPI PHP create SSL - wildcard

Discussion in 'cPanel Developers' started by Harvinder Singh, Dec 5, 2015.

  1. Harvinder Singh

    Harvinder Singh Registered

    Joined:
    Dec 5, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Root Administrator
    Hi All

    I am already using the XMLAPI-PHP to create subdomains and couple of other things by using the belo calls:

    PHP:
    api1_query($cpuser'SubDomain''addsubdomain', array($sub,$domain,0,0,$folder));
    api1_query($cpuser'SubDomain''delsubdomain', array($sub,$domain,0,0,$folder));
    api1_query($cpuser"Mysql""adddb", array($db));
    api1_query($cpuser"Mysql""deldb", array($db));
    api1_query($cpuser"Mysql""adduser", array($user,$pass));
    api1_query($cpuser"Mysql""adduserdb", array(
    api1_query($cpuser"Mysql""deluser", array($user,$pass));
    I have just installed a wildcard SSL to the server and want to install that certificate to any new subdomain I am creating with the above calls. Is there any similar way to achieve this?

    Since this is the wildcard SSL, the certificate and all other details are already present on the server. In CPanel I basically select the same certificate and choose the relevant subdomain to install. Doing the same procedure with the above XMLAPI PHP calls would be very handy for my application if possible.

    Thanks in advance
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. Harvinder Singh

    Harvinder Singh Registered

    Joined:
    Dec 5, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Root Administrator
    Thanks a lot.

    I managed to use the api2 query for this to work and it works great.

    PHP:
    $xmlapi->api2_query($cpuser'SSL''installssl',
        array(
            
    'domain'         => $ssl_domain,
            
    'cabundle'       => $cabundle,
            
    'crt'             => $crt,
            
    'key'            => $key
        
    ));
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page