Skip to content

Commit

Permalink
tls: server: Clean up when TLS connection fails to establish
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubli committed Jun 26, 2024
1 parent ddd7abb commit 89eff42
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/monitor-types/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ class TlsMonitorType extends MonitorType {
response: unescape(monitor.tcpStartTlsResponse || ""),
};

const tlsSocket = await this.connect(abortController.signal, tlsOptions);
const tlsSocket = await this.connect(abortController.signal, tlsOptions)
.catch((error) => {
abortController.abort();
clearTimeout(timeoutID);
throw error;
})
;
let tlsSocketClosed = false;
tlsSocket.on("close", () => {
tlsSocketClosed = true;
Expand Down

0 comments on commit 89eff42

Please sign in to comment.