We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfdae1c commit 338a94fCopy full SHA for 338a94f
lib/pem.js
@@ -360,10 +360,10 @@ function fetchCertificateData(certData, callback){
360
}
361
362
certValues.validity = {};
363
- tmp = certData.match(/Not Before\s?:\s?([^\n]*)\n/)
364
- certValues.validity.start = tmp && tmp[1] || "";
365
- tmp = certData.match(/Not After\s?:\s?([^\n]*)\n/)
366
- certValues.validity.end = tmp && tmp[1] || "";
+ if ((tmp = certData.match(/Not Before\s?:\s?([^\n]*)\n/)) && tmp.length>1)
+ certValues.validity.start = Date.parse(tmp[1]);
+ if ((tmp = certData.match(/Not After\s?:\s?([^\n]*)\n/)) && tmp.length>1)
+ certValues.validity.end = Date.parse(tmp[1]);
367
368
callback(null, certValues);
369
0 commit comments