move attachCertInfo to utils.js
This commit is contained in:
parent
ae91c08dd1
commit
a0d01815df
12
lib/utils.js
12
lib/utils.js
|
@ -5,6 +5,18 @@ var homeRe = new RegExp("^~(\\/|\\\|\\" + path.sep + ")");
|
||||||
var re = /^[a-zA-Z0-9\.\-]+$/;
|
var re = /^[a-zA-Z0-9\.\-]+$/;
|
||||||
var punycode = require('punycode');
|
var punycode = require('punycode');
|
||||||
|
|
||||||
|
module.exports.attachCertInfo = function (results) {
|
||||||
|
var getCertInfo = require('./cert-info').getCertInfo;
|
||||||
|
// XXX Note: Parsing the certificate info comes at a great cost (~500kb)
|
||||||
|
var certInfo = getCertInfo(results.cert);
|
||||||
|
|
||||||
|
//results.issuedAt = arr[3].mtime.valueOf()
|
||||||
|
results.issuedAt = Date(certInfo.notBefore.value).valueOf(); // Date.now()
|
||||||
|
results.expiresAt = Date(certInfo.notAfter.value).valueOf();
|
||||||
|
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
module.exports.isValidDomain = function (domain) {
|
module.exports.isValidDomain = function (domain) {
|
||||||
if (re.test(domain)) {
|
if (re.test(domain)) {
|
||||||
return domain;
|
return domain;
|
||||||
|
|
Loading…
Reference in New Issue