certificate-details
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -45,3 +45,3 @@ 'use strict'; | ||
callback(null, { | ||
var result = { | ||
subject: { | ||
@@ -69,3 +69,9 @@ country: details.subject.C, | ||
} | ||
}); | ||
}; | ||
if (details.subjectaltname) { | ||
result.subject.alternativeNames = [details.subjectaltname.substring(details.subjectaltname.indexOf(':') + 1)]; | ||
} | ||
callback(null, result); | ||
}); | ||
@@ -72,0 +78,0 @@ |
@@ -45,3 +45,3 @@ 'use strict'; | ||
callback(null, { | ||
const result = { | ||
subject: { | ||
@@ -69,3 +69,11 @@ country: details.subject.C, | ||
} | ||
}); | ||
}; | ||
if (details.subjectaltname) { | ||
result.subject.alternativeNames = [ | ||
details.subjectaltname.substring(details.subjectaltname.indexOf(':') + 1) | ||
]; | ||
} | ||
callback(null, result); | ||
}); | ||
@@ -72,0 +80,0 @@ |
{ | ||
"name": "certificate-details", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "certificate-details gets the details from an SSL certificate.", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -71,3 +71,34 @@ 'use strict'; | ||
}); | ||
test('returns the certificate details with SANs.', done => { | ||
certificateDetails.get(path.join(__dirname, '..', 'keys', 'localhost-with-san'), (err, details) => { | ||
assert.that(err).is.null(); | ||
assert.that(details).is.ofType('object'); | ||
assert.that(details.subject).is.equalTo({ | ||
country: 'DE', | ||
state: 'Baden-Wuerttemberg', | ||
location: 'Riegel am Kaiserstuhl', | ||
organisation: 'the native web GmbH', | ||
commonName: 'localhost', | ||
email: 'hello@thenativeweb.io', | ||
alternativeNames: [ '1.2.3.4' ] | ||
}); | ||
assert.that(details.issuer).is.equalTo({ | ||
country: 'DE', | ||
state: 'Baden-Wuerttemberg', | ||
location: 'Riegel am Kaiserstuhl', | ||
organisation: 'the native web GmbH', | ||
commonName: 'localhost', | ||
email: 'hello@thenativeweb.io' | ||
}); | ||
assert.that(details.metadata).is.equalTo({ | ||
validFrom: new Date(2017, 9, 6, 14, 15, 38), | ||
validTo: new Date(2047, 9, 4, 14, 15, 38), | ||
fingerprint: '7E:1B:07:5A:8A:F8:B2:96:0D:AA:0C:05:35:48:37:08:F8:34:B8:07', | ||
serialNumber: 'DCF2E1CF89D0A5AD' | ||
}); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13
18579
281
4