rob05c commented on a change in pull request #6522:
URL: https://github.com/apache/trafficcontrol/pull/6522#discussion_r809489795
##########
File path: cache-config/t3c-apply/torequest/cmd.go
##########
@@ -333,6 +336,22 @@ func checkRefs(cfg config.Cfg, cfgFile []byte, filesAdding
[]string) error {
return nil
}
+//checkCert checks the validity of the ssl certificate
+func checkCert(c []byte) error {
+ block, _ := pem.Decode(c)
+ cert, err := x509.ParseCertificate(block.Bytes)
+ if err != nil {
+ return err
+ }
+ if cert.NotAfter.Unix() < time.Now().Unix() {
+ err = errors.New("Certificate expired: " +
cert.NotAfter.Format("Jan 2, 2006 15:04 MST"))
Review comment:
Nitpick: it'd be good to put this date string in a constant, especially
since it's used twice
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]