Skip to content

Commit 8f3d4fb

Browse files
authored
Merge pull request #2027 from murgatroid99/grpc-js_server_secure_errors
grpc-js: Add secureConnection error handling in server
2 parents 903cce1 + b9deb5b commit 8f3d4fb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/grpc-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grpc/grpc-js",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"description": "gRPC Library for Node - pure JS implementation",
55
"homepage": "https://grpc.io/",
66
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

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)