Skip to content

Commit

Permalink
Fixes #39
Browse files Browse the repository at this point in the history
  • Loading branch information
dyaa committed Apr 16, 2020
1 parent 77b93f7 commit 6dee9fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssl-checker",
"version": "2.0.4",
"version": "2.0.5",
"description": "ssl-checker",
"main": "./lib/cmjs/index.js",
"module": "./lib/cmjs/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const sslChecker = (
agent: false,
method: "HEAD",
port: 443,
rejectUnauthorized: false
rejectUnauthorized: false,
}
): Promise<IResolvedValues> =>
new Promise((resolve, reject) => {
Expand All @@ -53,7 +53,7 @@ const sslChecker = (
(res: http.IncomingMessage) => {
const {
valid_from,
valid_to
valid_to,
} = (res.connection as tls.TLSSocket).getPeerCertificate();

const validTo = new Date(valid_to);
Expand All @@ -64,7 +64,7 @@ const sslChecker = (
((res.socket as { authorized?: boolean })
.authorized as boolean) || false,
validFrom: new Date(valid_from).toISOString(),
validTo: validTo.toISOString()
validTo: validTo.toISOString(),
});
}
);
Expand All @@ -76,4 +76,4 @@ const sslChecker = (
}
});

module.exports = sslChecker;
export default sslChecker;

0 comments on commit 6dee9fb

Please sign in to comment.