@ NonNull private static OkHttpClient getNewOkHttpClient ( boolean enableTLS ) { OkHttpClient . Builder client = new OkHttpClient . Builder ( ) . connectTimeout ( DEFAULT_CONNECT_TIMEOUT , TimeUnit . SECONDS ) . readTimeout ( DEFAULT_READ_TIMEOUT , TimeUnit . SECONDS ) ; if ( enableTLS ) { client = enableTls12 ( client ) ; } return client . build ( ) ; }
Creates an OkHttpClient optionally enabling TLS