use of org.thoughtcrime.securesms.push.SignalServiceTrustStore in project Signal-Android by signalapp.
the class BadgeLoader method createFactory.
public static Factory createFactory() {
try {
OkHttpClient baseClient = ApplicationDependencies.getOkHttpClient();
SSLContext sslContext = SSLContext.getInstance("TLS");
TrustStore trustStore = new SignalServiceTrustStore(ApplicationDependencies.getApplication());
TrustManager[] trustManagers = BlacklistingTrustManager.createFor(trustStore);
sslContext.init(null, trustManagers, null);
OkHttpClient client = baseClient.newBuilder().sslSocketFactory(new Tls12SocketFactory(sslContext.getSocketFactory()), (X509TrustManager) trustManagers[0]).connectionSpecs(Util.immutableList(ConnectionSpec.RESTRICTED_TLS)).build();
return new Factory(client);
} catch (NoSuchAlgorithmException | KeyManagementException e) {
throw new AssertionError(e);
}
}
use of org.thoughtcrime.securesms.push.SignalServiceTrustStore in project Signal-Android by WhisperSystems.
the class BadgeLoader method createFactory.
public static Factory createFactory() {
try {
OkHttpClient baseClient = ApplicationDependencies.getOkHttpClient();
SSLContext sslContext = SSLContext.getInstance("TLS");
TrustStore trustStore = new SignalServiceTrustStore(ApplicationDependencies.getApplication());
TrustManager[] trustManagers = BlacklistingTrustManager.createFor(trustStore);
sslContext.init(null, trustManagers, null);
OkHttpClient client = baseClient.newBuilder().sslSocketFactory(new Tls12SocketFactory(sslContext.getSocketFactory()), (X509TrustManager) trustManagers[0]).connectionSpecs(Util.immutableList(ConnectionSpec.RESTRICTED_TLS)).build();
return new Factory(client);
} catch (NoSuchAlgorithmException | KeyManagementException e) {
throw new AssertionError(e);
}
}
Aggregations