ssl-checker
npm install ssl-checker
 


Simply add ssl-checker as a dependency:
``bash
$ npm install ssl-checker --save # npm i -s ssl-checker
Usage
`ts
import sslChecker from "ssl-checker";const getSslDetails = async (hostname: string) =>
await sslChecker(hostname
ex. badssl.com);
`Options
All valid
https.RequestOptions values.| Option | Default | Description |
| ------------------ | ------- | ------------------------------------------------- |
| method | HEAD | Can be GET too |
| port | 443 | Your SSL/TLS entry point |
| agent | default | Default HTTPS agent with { maxCachedSessions: 0 } |
| rejectUnauthorized | false | Skips authorization by default |
| validateSubjectAltName | false | Skips returning/validating
subjectaltname |`ts
sslChecker("dyaa.me", { method: "GET", port: 443, validateSubjectAltName: true }).then(console.info);
`Response Example
`json
{
"daysRemaining": 90,
"valid": true,
"validFrom": "issue date",
"validTo": "expiry date",
"validFor": ["www.example.com", "example.com"]
}
`NOTE:
validFor is only returned if validateSubjectAltName is set to true`#### License
Copylefted (c) 8008 :trollface: [Dyaa Eldin Moustafa][1] Licensed under the [MIT license][2].
[1]: https://dyaa.me/
[2]: https://github.com/dyaa/node-ssl-checker/blob/master/LICENSE