XMLAPI PHP create SSL - wildcard
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));
[/PHP]
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
-
Hello :) The following UAPI function is utilized for installing SSL certificates: UAPI Functions - SSL::install_ssl - Software Development Kit - cPanel Documentation You could develop a script that runs automatically when subdomains are created through the use of standardized hooks: Guide to Standardized Hooks - Software Development Kit - cPanel Documentation Thank you. 0 -
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 ));[/PHP] 0 -
I am happy to see it works well. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
3 comments