<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Hi Mikael,<br><br>The server should send the subject in a header which you can get and maybe build a check on.<br></div><div><br data-mce-bogus="1"></div><div>e.g. the HEAD command (libwww-perl package)<br><br>$ /usr/bin/HEAD -s https://google.com/ | grep Client-SSL-Cert-Subject<br>Client-SSL-Cert-Subject: /CN=www.google.com<br><br>or just straight perl:<br>$ perl -MLWP::UserAgent -le'print foreach LWP::UserAgent->new->get("https://atlassian.com")->headers->{"client-ssl-cert-subject"}'<br>/C=AU/ST=New South Wales/L=Sydney/O=Atlassian Pty Ltd/CN=*.atlassian.com<br><br>If the date is in YYYY-MM-DD format you could grab it, convert it to an epoch time and calculate the seconds left with:<br><br>$ perl -MTime::Local -MLWP::UserAgent -le'LWP::UserAgent->new->get("https://your.vendor.com")->headers->{"client-ssl-cert-subject"} =~ /(\d{4})\-(\d\d)\-(\d\d)/ and print timelocal(0,0,0,$2,$1,$0) - time'<br></div><div><br data-mce-bogus="1"></div><div>cheers,<br></div><div>Woody<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Mikael Janeld" <Mikael.janeld@tietoevry.com><br><b>To: </b>"help" <help@monitoring-plugins.org><br><b>Sent: </b>Wednesday, 3 November, 2021 8:00:03 PM<br><b>Subject: </b>Check date in Subject/OU in a Certificate.<br></div><div><br><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style></div><div data-marker="__QUOTED_TEXT__">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">We have a vendor/application that stamps the expire date for a license in the Subject/OU field in a certificate and I am trying to found a way that we can use OP5 to monitor that.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I have checked the “check_https_certificate” but it only checks when the certificates expires and in the application certificate the certificate expire date and the license expire date are different.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I hope there is a way to solve this, either with “check_https_certificate” check or if we can use another check that can do this or maybe create a new check for this, can you help me with that or point me to a way that
 I can solve it?</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'arial' , sans-serif;color:#505050" lang="EN-US">Med vänlig hälsning / Best regards,
</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
<br>
</span><b><span style="font-size:10pt;font-family:'arial' , sans-serif;color:#063954" lang="EN-US">Mikael Janeld</span></b><span style="font-size:10pt;font-family:'arial' , sans-serif;color:#505050" lang="EN-US">,
 VMware & Windows Specialist </span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
<br>
</span><b><span style="font-size:10pt;font-family:'arial' , sans-serif;color:#063954" lang="EN-US">TietoEVRY,
</span></b><b><span style="font-size:10pt;font-family:'arial' , sans-serif;color:#063954" lang="EN-US">Financial Services - Card Acquiring</span></b><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
</span><span style="font-size:10pt;font-family:'arial' , sans-serif;color:#505050" lang="EN-US">email
<a href="mailto:mikael.janeld@tietoevry.com" target="_blank" rel="nofollow noopener noreferrer"><span style="color:#0563c1">mikael.janeld@tietoevry.com</span></a>, mobile +46 (0)73 236 5240
</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
</span><span style="font-size:10pt;font-family:'arial' , sans-serif;color:#505050" lang="EN-US">Ekensbergsvägen 113, Solna</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
<br>
</span><span style="font-family:'arial' , sans-serif"><img style="width:4.9791in;height:1.1458in" id="Picture_x0020_8" src="cid:image001.jpg@01D7D099.16FE3090" width="478" height="110" border="0"></span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
<br>
</span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#063954" lang="EN-US">Tieto and EVRY are joining forces.
</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
<br>
</span><span style="font-family:'arial' , sans-serif"><a href="http://www.tietoevry.com/" target="_blank" rel="nofollow noopener noreferrer"><span style="font-size:8pt;color:#063954" lang="EN-US">www.tietoevry.com</span></a></span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#063954">
</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
<br>
</span><span style="font-family:'arial' , sans-serif"><a href="https://twitter.com/tietoevry" target="_blank" rel="nofollow noopener noreferrer"><span style="font-size:8pt;color:#063954" lang="EN-US">Twitter</span></a></span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#063954" lang="EN-US">
 | </span><span style="font-family:'arial' , sans-serif"><a href="https://www.facebook.com/tietoevry/" target="_blank" rel="nofollow noopener noreferrer"><span style="font-size:8pt;color:#063954" lang="EN-US">Facebook</span></a></span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#063954" lang="EN-US">
 | </span><span style="font-family:'arial' , sans-serif"><a href="https://www.linkedin.com/company/tietoevry/" target="_blank" rel="nofollow noopener noreferrer"><span style="font-size:8pt;color:#063954" lang="EN-US">LinkedIn</span></a></span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#063954">
</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
<br>
</span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#505050" lang="EN-US">Please note: The information contained in this message may be legally privileged,
</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
</span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#505050" lang="EN-US">confidential and protected from disclosure. If you received this in error, please notify
</span><span style="font-family:'arial' , sans-serif" lang="EN-US"><br>
</span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#505050" lang="EN-US">the sender immediately and delete the message from your computer.
</span><span style="font-size:8pt;font-family:'arial' , sans-serif;color:#505050">Thank you.</span><span style="font-size:10pt;font-family:'arial' , sans-serif"></span></p>
<p class="MsoNormal"> </p>
</div><br></div></div></body></html>