Switch to BC on unsupported protocol

This commit is contained in:
M66B
2025-09-18 17:40:19 +02:00
parent 170cfce52d
commit 7a987e71e7
2 changed files with 99 additions and 64 deletions

View File

@@ -73,6 +73,7 @@ import javax.mail.MessagingException;
import javax.net.SocketFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
@@ -504,6 +505,17 @@ public class ConnectionHelper {
return false;
}
static boolean isUnsupportedProtocol(Throwable ex) {
while (ex != null) {
if (ex instanceof SSLHandshakeException &&
ex.getMessage() != null &&
ex.getMessage().contains("UNSUPPORTED_PROTOCOL"))
return true;
ex = ex.getCause();
}
return false;
}
static boolean isAborted(Throwable ex) {
while (ex != null) {
String msg = ex.getMessage();