Simple PHP script to check SSL expiry
MIT License
A simple php script to check the expiry of SSL certificates.
This script has been tested only on Ubuntu 16.04+ using PHP7.
sslcheck
file.sslcheck
file is executable (chmod a+x sslcheck
)../sslcheck www.example.com
.If you can't execute the script directly you may need to envoke the script via php (php sslcheck www.example.com
);
You can check multiple domains by listing them all out when running the script:
sslcheck www.google.com www.example.com www.github.com
If a domain is found to have multiple A or AAAA records then each will be checked individually and the IP will be shown alongside the domain in the output.
The file email-example.sh
is a simple script showing how this can be used via email. Simply read the comments at the top of the script and change the configuration variables to set it up. If the mail
command is not available on your system you may need to install it (ubuntu: sudo apt-get install mailutils
). A good idea would be to set this up as a cron job to send a weekly report.