We use LetsEncrypt and monitor the SSL certificate expiration dates locally by parsing the actual certificate files, but if you require a way to remotely monitor a third-party SSL certificate in order to ensure that the renewal process hasn't failed, here’s some #cfml / #java to do just that.
Source
<!--- 20190419 | |
BLOG: https://dev.to/gamesover/identify-ssl-expiration-date-using-coldfusion-1lm5 ---> | |
<cfset HostToTest = "letsencrypt.org"> | |
<cfset factory = CreateObject("java", "javax.net.ssl.HttpsURLConnection").getDefaultSSLSocketFactory()> | |
<cfset socket = factory.createSocket(HostToTest, JavaCast("int",443))> | |
<cfset socket.startHandshake()> | |
<cfset certs = socket.getSession().getPeerCertificates()> | |
<cfif IsArray(certs)> | |
<cfloop from="1" to="#ArrayLen(certs)#" index="i"> | |
<cfset cert = certs[i]> | |
<cfoutput> | |
<div>#cert.getSubjectDN().getName()# - Valid Until <b>#DateFormat(cert.getNotAfter())#</b></div> | |
</cfoutput> | |
</cfloop> | |
</cfif> | |
<cfset socket.close()> |
Top comments (3)
LetsEncrypt have revoked around 3 million certs last night due to a bug that they found. Are you impacted by this, Check out ?
DevTo
[+] dev.to/dineshrathee12/letsencrypt-...
GitHub
[+] github.com/dineshrathee12/Let-s-En...
LetsEncryptCommunity
[+] community.letsencrypt.org/t/letsen...
No, we weren't impacted by it. I immediately forwarded a tweet regarding it to my business partner and we currently aren't generating the types of certs that are affected.
Nice one :)