Skip to content

Commit 5d7e8c0

Browse files
authored
🤖 Merge PR DefinitelyTyped#72054 fix(@types/node): https.RequestOptions.checkServerIdentity is always called with DetailedPeerCertificate by @pimlie
1 parent 59c5855 commit 5d7e8c0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎types/node/https.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ declare module "https" {
1616
& http.RequestOptions
1717
& tls.SecureContextOptions
1818
& {
19-
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
19+
checkServerIdentity?:
20+
| ((hostname: string, cert: tls.DetailedPeerCertificate) => Error | undefined)
21+
| undefined;
2022
rejectUnauthorized?: boolean | undefined; // Defaults to true
2123
servername?: string | undefined; // SNI TLS Extension
2224
};

‎types/node/test/https.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import * as url from "node:url";
5353
https.request(new url.URL("http://www.example.com/xyz"), opts, (res: http.IncomingMessage): void => {});
5454

5555
https.request(new url.URL("https://www.example.com"), {
56-
checkServerIdentity: (host: string, cert: tls.PeerCertificate): Error | undefined => new Error("foo"),
56+
checkServerIdentity: (host: string, cert: tls.DetailedPeerCertificate): Error | undefined => new Error("foo"),
5757
});
5858

5959
https.globalAgent.options.ca = [];

0 commit comments

Comments
 (0)