mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-07 17:43:18 +02:00
Switch to BC on unsupported protocol
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user