I don't begrudge people writing a tool to learn, but it should be noted that this wheel has already been invented:
* https://github.com/matteocorti/check_ssl_cert
* https://exchange.nagios.org/directory/Plugins/Security/check...
* https://github.com/narbehaj/ssl-checker
* https://github.com/Matty9191/ssl-cert-check