Simply add ssl-checker
as a dependency:
$ npm install ssl-checker --save # npm i -s ssl-checker
# Or if you prefer using yarn (https://yarnpkg.com/lang/en/)
$ yarn add ssl-checker
import sslChecker from "ssl-checker";
const getSslDetails = async (hostname: string) =>
await sslChecker(hostname`ex. badssl.com`);
Option | Default | |
---|---|---|
method | HEAD | can be GET too |
port | 443 | Your ssl entrypoint |
agent | I dont know why but if you'd like provide agent id |
sslChecker("dyaa.me", { method: "GET", port: 443 }).then(console.info);
{
"daysRemaining": 90,
"valid": true,
"validFrom": "issue date",
"validTo": "expiry date",
"validFor": ["www.example.com", "example.com"]
}
Copylefted (c) 8008 Dyaa Eldin Moustafa Licensed under the MIT license.