public static OwnCloudClient createOwnCloudClient(Uri uri, Context context, boolean followRedirects,
boolean useNextcloudUserAgent) {
try {
NetworkUtils.registerAdvancedSslContext(true, context);
} catch (GeneralSecurityException e) {
Log_OC.e(TAG, "Advanced SSL Context could not be loaded. Default SSL management in" +
" the system will be used for HTTPS connections", e);
} catch (IOException e) {
Log_OC.e(TAG, "The local server truststore could not be read. Default SSL management" +
" in the system will be used for HTTPS connections", e);
}
OwnCloudClient client = new OwnCloudClient(uri, NetworkUtils.getMultiThreadedConnManager(),
useNextcloudUserAgent);
client.setDefaultTimeouts(DEFAULT_DATA_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT);
client.setFollowRedirects(followRedirects);
return client;
}