diff options
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 6 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/SSLSocketHelper.java | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 289823f79..df871dd83 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -1091,7 +1091,11 @@ public class XmppConnectionService extends Service { public void onCreate() { OmemoSetting.load(this); ExceptionHelper.init(getApplicationContext()); - Security.insertProviderAt(Conscrypt.newProvider(), 1); + try { + Security.insertProviderAt(Conscrypt.newProvider(), 1); + } catch (Throwable throwable) { + Log.e(Config.LOGTAG, "unable to initialize security provider", throwable); + } Resolver.init(this); this.mRandom = new SecureRandom(); updateMemorizingTrustmanager(); diff --git a/src/main/java/de/pixart/messenger/utils/SSLSocketHelper.java b/src/main/java/de/pixart/messenger/utils/SSLSocketHelper.java index 5a1e97551..ce8aa009f 100644 --- a/src/main/java/de/pixart/messenger/utils/SSLSocketHelper.java +++ b/src/main/java/de/pixart/messenger/utils/SSLSocketHelper.java @@ -90,7 +90,11 @@ public class SSLSocketHelper { } public static SSLContext getSSLContext() throws NoSuchAlgorithmException { - return SSLContext.getInstance("TLSv1.3"); + try { + return SSLContext.getInstance("TLSv1.3"); + } catch (NoSuchAlgorithmException e) { + return SSLContext.getInstance("TLSv1.2"); + } } public static void log(Account account, SSLSocket socket) { |