{"id":259,"date":"2023-06-27T10:00:00","date_gmt":"2023-06-27T17:00:00","guid":{"rendered":"https:\/\/dejal.com\/blog\/?p=259"},"modified":"2023-05-29T17:55:43","modified_gmt":"2023-05-30T00:55:43","slug":"how-can-i-use-simon-to-check-for-an-expired-website-ssl-certificate","status":"publish","type":"post","link":"https:\/\/dejal.com\/blog\/how-can-i-use-simon-to-check-for-an-expired-website-ssl-certificate\/","title":{"rendered":"How can I use Simon to check for an expired website SSL certificate?"},"content":{"rendered":"<body><p><\/p>\n<p>I received a customer query asking how to use <a href=\"https:\/\/dejal.com\/simon\/\">Simon<\/a> to check for an expired website SSL certificate.<\/p>\n<p>Of course, Simon is very flexible, so even if there isn\u2019t a built-in service for this specific case, if you can do it in the <strong>Terminal<\/strong>, you can probably create a custom script-based service in Simon to do it, too.<\/p>\n<p>There are a number of ways to get certificate information, but this is one simple approach (if you know of a better way, let me know!).<\/p>\n<p>I created a new script-based service, using the basic C shell, a one-line command, and a custom variable for the host name:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dejal.com\/files\/2020\/simon\/website-certificate\/service.png?resize=891%2C512&#038;ssl=1\" alt=\"Website Certificate service screenshot\" width=\"891\" height=\"512\" border=\"0\" loading=\"lazy\"><\/p>\n<p>I then created a new test using this service. When accessing a server with an expired certificate, the output includes a \u201c<code>verify return code<\/code>\u201d message of \u201c<code>certificate has expired<\/code>\u201c, so I used a <strong>Block<\/strong> filter to look at just that text (I pasted \u201c<code>Verify return code: <\/code>\u201d in the <strong>Start<\/strong> text, and an <strong>Option-Return<\/strong> in the <strong>End<\/strong> text), then a <strong>Find Required<\/strong> filter to make the test result in a failure if it doesn\u2019t find \u201c<code>ok<\/code>\u201c, and finally an <strong>Override Custom<\/strong> filter if a failure, to output the error message:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dejal.com\/files\/2020\/simon\/website-certificate\/test-failure.png?resize=891%2C512&#038;ssl=1\" alt=\"Website Certificate test screenshot\" width=\"891\" height=\"512\" border=\"0\" loading=\"lazy\"><\/p>\n<p>For the success case, the last filter doesn\u2019t apply, so it just outputs the \u201c<code>ok<\/code>\u201d:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dejal.com\/files\/2020\/simon\/website-certificate\/test-success.png?resize=891%2C512&#038;ssl=1\" alt=\"Website Certificate test screenshot\" width=\"891\" height=\"512\" border=\"0\" loading=\"lazy\"><\/p>\n<p>Want to use this service? You can easily add it yourself, or import it by downloading from the <a href=\"https:\/\/dejal.com\/simon\/extras\/\">Simon Extras page<\/a>.<\/p>\n<p>I hope you found the techniques in this post helpful.<\/p>\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>I received a customer query asking how to use Simon to check for an expired website SSL certificate. Of course, Simon is very flexible, so even if there isn\u2019t a built-in service for this specific case, if you can do it in the Terminal, you can probably create a custom script-based service in Simon to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[16,4],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-faq","category-simon"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":1,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":260,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/posts\/259\/revisions\/260"}],"wp:attachment":[{"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/categories?post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dejal.com\/blog\/wp-json\/wp\/v2\/tags?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}