API2 SSL listcrts get expiration date

stapuff106

Member
Aug 4, 2017
17
1
3
Chicago
cPanel Access Level
Root Administrator
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
 

stapuff106

Member
Aug 4, 2017
17
1
3
Chicago
cPanel Access Level
Root Administrator
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.
 

stapuff106

Member
Aug 4, 2017
17
1
3
Chicago
cPanel Access Level
Root Administrator
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
 
  • Like
Reactions: cPanelMichael

stapuff106

Member
Aug 4, 2017
17
1
3
Chicago
cPanel Access Level
Root Administrator
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
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.