Submitted by craigh on Tue, 09/29/2020 - 11:40 Pro Licensee
Hi there,
Is there a way to list all certificates on the server? I see the virtualmin list-certs
command ( https://www.virtualmin.com/documentation/developer/cli/list_certs ), but there seem to be no options to display or sort on the expiry dates. That's the key information for me, as I know that a bunch of renewals have failed (due to seeing the subject lines in my logs), but I don't know how to look them up en masse without bothering the user and asking them to tell me information that I don't know about my own server.
Thanks.
Craig
Status:
Closed (fixed)
Virtualmin version:
6.12
Webmin version:
1.955
Comments
Hi,
We have
virtualmin-get-domains-ssl-status.pl
command that I created specifically for this single purpose - to display certificates expiration date on the console using a table like output.Try
Submitted by craigh on Tue, 09/29/2020 - 16:50 Pro Licensee Comment #2
Hi Ilia,
Thanks very much. That got me the information I was looking for. Although sort options would be nice. :)
Craig
Yes, it would. We will discuss with Jamie about adding it as part of
virtualmin
command.Submitted by JamieCameron on Tue, 09/29/2020 - 19:43 Comment #4
I could add expiry dates and other information to the output from
list-certs
?Submitted by craigh on Tue, 09/29/2020 - 20:31 Pro Licensee Comment #5
Hi Jamie,
I presume that's what Ilia's suggesting, and it sounds good to me.
Craig
Submitted by craigh on Tue, 09/29/2020 - 20:32 Pro Licensee Comment #6
With both alphabetical and date sort options.
Submitted by JamieCameron on Wed, 09/30/2020 - 00:49 Comment #7
You could actually do this with a shell script already :
Submitted by craigh on Wed, 09/30/2020 - 01:32 Pro Licensee Comment #8
Thanks Jamie, but not nearly as neat and table-like as Ilia's script.
It also had a lot of extraneous output:
Virtual server Ltd. does not exist
Displays SSL certificate information for some domain.
virtualmin get-ssl --domain name
"Ltd." in this case being the third word of the virtual server's description, the other two words also generating the same output.
Submitted by JamieCameron on Wed, 09/30/2020 - 20:41 Comment #9
Sorry, I gave the script wrong. It should be :
Submitted by craigh on Wed, 09/30/2020 - 22:53 Pro Licensee Comment #10
Thanks. That works without errors.
Yes, this is the reason why I implemented it in the first place.
I could pretty easily make this an API command, I think. I'll work on it.
Okay, I have added this functionality to the core Virtualmin API, with additional sorting capabilities based on selected column and rich domain matching:
Example of usage:
Example of output
Submitted by craigh on Sat, 10/10/2020 - 16:07 Pro Licensee Comment #13
Thanks Ilia. Looks good. I installed the script at
/usr/libexec/webmin/virtual-server
on a Pro server, namedlist-certs-expiry.pl
owned byroot
with 755 permissions, but I had to change the path to perl on my system in the head of your script. The output was perfect.Thanks!
Craig