Skip to content

Commit

Permalink
JGRP-2637 Quiet SSLHandshakeExceptions caused by closed sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
tristantarrant committed Aug 19, 2022
1 parent f671e6f commit cf70c50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/org/jgroups/blocks/cs/TcpConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.jgroups.util.Util;

import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLSocket;
import java.io.*;
import java.net.*;
Expand Down Expand Up @@ -313,7 +314,10 @@ public void run() {
catch(Exception e) {
//noinspection StatementWithEmptyBody
if (e instanceof SSLException && e.getMessage().contains("Socket closed")) {
// regular use case when a peer closes its connection - we don't want to log this as exception
; // regular use case when a peer closes its connection - we don't want to log this as exception
}
else if (e instanceof SSLHandshakeException && e.getCause() instanceof EOFException) {
; // Ignore SSL handshakes closed early (usually liveness probes)
}
else {
if(server.logDetails())
Expand Down

0 comments on commit cf70c50

Please sign in to comment.