From 277e7f070ffd088fce0cfa9edd303f6acc61014e Mon Sep 17 00:00:00 2001 From: ShareASmile <60492161+ShareASmile@users.noreply.github.com> Date: Sun, 14 Jul 2024 21:09:46 +0530 Subject: [PATCH] Update TLSSocketFactoryCompat.java --- .../schabi/newpipelegacy/util/TLSSocketFactoryCompat.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipelegacy/util/TLSSocketFactoryCompat.java b/app/src/main/java/org/schabi/newpipelegacy/util/TLSSocketFactoryCompat.java index 47f966de8..0518de846 100644 --- a/app/src/main/java/org/schabi/newpipelegacy/util/TLSSocketFactoryCompat.java +++ b/app/src/main/java/org/schabi/newpipelegacy/util/TLSSocketFactoryCompat.java @@ -33,11 +33,10 @@ public TLSSocketFactoryCompat() throws KeyManagementException, NoSuchAlgorithmEx internalSSLSocketFactory = context.getSocketFactory(); } - public TLSSocketFactoryCompat( - final TrustManagerFactory trustManagerFactory) + public TLSSocketFactoryCompat(final TrustManager[] tm) throws NoSuchAlgorithmException, KeyManagementException { final SSLContext context = SSLContext.getInstance("TLS"); - context.init(null, trustManagerFactory.getTrustManagers(), null); + context.init(null, tm, new java.security.SecureRandom()); internalSSLSocketFactory = context.getSocketFactory(); }