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