import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
+import java.util.Objects;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;
} catch (Exception exception) {
exception.printStackTrace();
} finally {
- tsf.close();
-
+ if (tsf != null) {
+ tsf.close();
+ }
}
return ctx;
}