Commit 7bef458b 7bef458b0ca5b0be6eabb5615cd180ab5cb6dabf by Christian Gerdes

Added a warning message for certificates about to expire within 14 days.

1 parent 4b3a68b7
......@@ -5,8 +5,10 @@ VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8ADAFB91-C10D-42C8-8499-30B3692C27F3}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
LIL_VSTT_Plugins.vsmdi = LIL_VSTT_Plugins.vsmdi
Local.testsettings = Local.testsettings
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LIL_VSTT_Plugins", "LIL_VSTT_Plugins\LIL_VSTT_Plugins.csproj", "{06A22593-601E-4386-917A-9835DE30E14E}"
......
......@@ -654,9 +654,15 @@ namespace LIL_VSTT_Plugins
myCertTrusted = false;
}
if(cer.NotAfter < DateTime.Now || cer.NotBefore > DateTime.Now)
if(cer.NotAfter < DateTime.Now)
{
e.WebTest.AddCommentToResult("Warning: Client Certificate has expired. Might not be trusted on server.");
e.WebTest.AddCommentToResult("Warning: Client Certificate has expired. Might not be trusted on server. Expired " + cer.NotAfter.ToString());
} else if (cer.NotBefore > DateTime.Now)
{
e.WebTest.AddCommentToResult("Warning: Client Certificate is not valid yet. Might not be trusted on server. Valid " + cer.NotBefore.ToString());
} else if (cer.NotAfter < DateTime.Now.AddDays(14))
{
e.WebTest.AddCommentToResult("Warning: Client Certificate will expire in less than 14 days. Better renew it soon. Expires " + cer.NotAfter.ToString());
}
// Check if we have a private key
......