Skip to content

Commit 03aa5d8

Browse files
authored
🤖 Merge PR DefinitelyTyped#74265 [node/tls] Added TLSSocket.servername by @ikeyan
1 parent 5123ad0 commit 03aa5d8

8 files changed

Lines changed: 20 additions & 0 deletions

File tree

types/node/node-tests/tls.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import {
6060
tlsSocket.enableTrace();
6161

6262
tlsSocket.encrypted; // $ExpectType true
63+
tlsSocket.servername; // $ExpectType string | false | null
6364

6465
const caCertificates: string[] = getCACertificates("default");
6566
const ciphers: string[] = getCiphers();

types/node/tls.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ declare module "node:tls" {
251251
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
252252
*/
253253
alpnProtocol: string | false | null;
254+
/**
255+
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
256+
*/
257+
servername: string | false | null;
254258
/**
255259
* Returns an object representing the local certificate. The returned object has
256260
* some properties corresponding to the fields of the certificate.

types/node/v20/test/tls.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import {
5858
tlsSocket.enableTrace();
5959

6060
tlsSocket.encrypted; // $ExpectType true
61+
tlsSocket.servername; // $ExpectType string | false | null
6162

6263
const ciphers: string[] = getCiphers();
6364
const curve: string = DEFAULT_ECDH_CURVE;

types/node/v20/tls.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ declare module "tls" {
245245
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
246246
*/
247247
alpnProtocol: string | false | null;
248+
/**
249+
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
250+
*/
251+
servername: string | false | null;
248252
/**
249253
* Returns an object representing the local certificate. The returned object has
250254
* some properties corresponding to the fields of the certificate.

types/node/v22/test/tls.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import {
6060
tlsSocket.enableTrace();
6161

6262
tlsSocket.encrypted; // $ExpectType true
63+
tlsSocket.servername; // $ExpectType string | false | null
6364

6465
const caCertificates: string[] = getCACertificates("default");
6566
const ciphers: string[] = getCiphers();

types/node/v22/tls.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ declare module "tls" {
245245
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
246246
*/
247247
alpnProtocol: string | false | null;
248+
/**
249+
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
250+
*/
251+
servername: string | false | null;
248252
/**
249253
* Returns an object representing the local certificate. The returned object has
250254
* some properties corresponding to the fields of the certificate.

types/node/v24/test/tls.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import {
6060
tlsSocket.enableTrace();
6161

6262
tlsSocket.encrypted; // $ExpectType true
63+
tlsSocket.servername; // $ExpectType string | false | null
6364

6465
const caCertificates: string[] = getCACertificates("default");
6566
const ciphers: string[] = getCiphers();

types/node/v24/tls.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ declare module "tls" {
245245
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
246246
*/
247247
alpnProtocol: string | false | null;
248+
/**
249+
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
250+
*/
251+
servername: string | false | null;
248252
/**
249253
* Returns an object representing the local certificate. The returned object has
250254
* some properties corresponding to the fields of the certificate.

0 commit comments

Comments
 (0)