API2 SSL listcrts get expiration date
Main objective is to get the expiration date from the SSL.
cPanel API2 SSl listcrts
returns nothing:
object(SimpleXMLElement)#2 (4) { ["apiversion">=> string(1) "2" ["event">=> object(SimpleXMLElement)#3 (1) { ["result">=> string(1) "1" } ["func">=> string(8) "listcrts" ["module">=> string(3) "SSL" }
However, I can see the SSL information exists using:
cPanel API2 SSLInfo fetchinfo
returns a complete SSL [data] array
redhat-release:CentOS release 6.8 (Final)
version:11.66.0.8
envtype:virtuozzo
CPANEL:current
-
Hello, Is there any reason you prefer to use cPanel API 2 over UAPI? You can use the following UAPI function for this purpose: UAPI Functions - SSL::list_certs - Software Development Kit - cPanel Documentation The "not_after" value in the output displays the certificate's expiration time. Thank you. 0 -
I appreciate the response back. API1 and API2 are pretty simple to use with php. I have looked at UAPI briefly, but have not found a "How to Setup & Use cPanel UAPI for Dummies" yet. 0 -
Hello, A general guide on using UAPI is available at: Guide to UAPI - Software Development Kit - cPanel Documentation Additionally, here's a thread you may find helpful when using UAPI functions with PHP: UAPI PHP Class Let us know if this helps. Thank you. 0 -
I appreciate your response. Looked over your initial response over the weekend and found the class you suggested in your latest response. Got it up and running last night.... so I appreciate you taking the time out to respond. Thanks, Puff 0 -
cPanelMichael - I had 1 question.... when I run the uapi SSL list_certs it return 6 data arrays in a var_dump response. I am using the AutoSSL in WHM so it is creating 1 SSL for domain, mail, etc. I see 1 date in WHM, but 6 different dates when I convert the not_after's. Why is it listing 6, why are the dates different, and only 1 not_after comes within a day of matching what is shown in WHM. Ok sorry... had more than 1 question. Puff 0 -
Why is it listing 6, why are the dates different, and only 1 not_after comes within a day of matching what is shown in WHM.
This indicates the certificates were issued at different times. For instance, this would happen if a subdomain or addon domain name was added to the cPanel account at later date than when the account was setup. Thank you.0
Please sign in to leave a comment.
Comments
6 comments