Skip to content

Commit db56e80

Browse files
committed
grpc-js: Add secureConnection error handling in server
1 parent 903cce1 commit db56e80

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/grpc-js/src/server.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,13 @@ export class Server {
371371
creds._getSettings()!
372372
);
373373
http2Server = http2.createSecureServer(secureServerOptions);
374+
http2Server.on('secureConnection', (socket: TLSSocket) => {
375+
/* These errors need to be handled by the user of Http2SecureServer,
376+
* according to https://github.com/nodejs/node/issues/35824 */
377+
socket.on('error', (e: Error) => {
378+
this.trace('An incoming TLS connection closed with error: ' + e.message);
379+
});
380+
});
374381
} else {
375382
http2Server = http2.createServer(serverOptions);
376383
}

0 commit comments

Comments
 (0)