diff --git a/java/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java b/java/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java index 400460cdee..26986f0aa0 100644 --- a/java/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java +++ b/java/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java @@ -77,6 +77,7 @@ public class PushServiceSocket { private static final String TAG = PushServiceSocket.class.getSimpleName(); + private static final OkHttpClient CLIENT = new OkHttpClient(); private static final String CREATE_ACCOUNT_SMS_PATH = "/v1/accounts/sms/code/%s"; private static final String CREATE_ACCOUNT_VOICE_PATH = "/v1/accounts/voice/code/%s"; @@ -612,7 +613,7 @@ private Response getConnection(String urlFragment, String method, String body) SSLContext context = SSLContext.getInstance("TLS"); context.init(null, trustManagers, null); - OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder() + OkHttpClient.Builder okHttpClientBuilder = CLIENT.newBuilder() .sslSocketFactory(context.getSocketFactory(), (X509TrustManager)trustManagers[0]) .connectTimeout(soTimeoutMillis, TimeUnit.MILLISECONDS) .readTimeout(soTimeoutMillis, TimeUnit.MILLISECONDS);