Program: 86136
Project: 86136
Buggy source:
/** 
 * Create a new OkHttpClient.
 * @param tls_only If this is true, only TLS v1 and newer will be used, SSLv3 will be disabled.We highly recommend to set this to true, if possible. This is currently a no-op on the default implementation and only used in the Android implementation!
 */
public OkHttpClient getNewOkHttpClient(boolean customssl,boolean tls_only,boolean allCipherSuites){
  OkHttpClient.Builder builder=new OkHttpClient.Builder();
  if (customssl && ssl_store_path != null) {
    try {
      if (trust_store == null) {
        trust_store=getKeyStore();
      }
      X509TrustManager trustManager=new AdditionalKeyStoresSSLSocketFactory.AdditionalKeyStoresTrustManager(trust_store);
      SSLSocketFactory sf=AdditionalKeyStoresSSLSocketFactory.createForOkHttp(trustManager);
      builder.sslSocketFactory(sf,trustManager);
      builder.addNetworkInterceptor(new CustomRedirectInterceptor());
      List<ConnectionSpec> connectionSpecs=new ArrayList<ConnectionSpec>();
      connectionSpecs.add(ConnectionSpec.MODERN_TLS);
      connectionSpecs.add(new ConnectionSpec.Builder(ConnectionSpec.COMPATIBLE_TLS).allEnabledCipherSuites().build());
      if (!tls_only) {
        connectionSpecs.add(new ConnectionSpec.Builder(ConnectionSpec.COMPATIBLE_TLS).tlsVersions(TlsVersion.SSL_3_0,TlsVersion.TLS_1_0).allEnabledCipherSuites().build());
      }
 else       if (allCipherSuites) {
        connectionSpecs.add(new ConnectionSpec.Builder(ConnectionSpec.COMPATIBLE_TLS).allEnabledCipherSuites().build());
      }
      connectionSpecs.add(ConnectionSpec.CLEARTEXT);
      builder.connectionSpecs(connectionSpecs);
      CookieManager cookieManager=new CookieManager();
      cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
      builder.cookieJar(new JavaNetCookieJar(cookieManager));
      return builder.build();
    }
 catch (    Exception e) {
      e.printStackTrace();
      return builder.build();
    }
  }
 else {
    return builder.build();
  }
}

Fixed version (ground truth):
/** 
 * Create a new OkHttpClient.
 * @param tls_only If this is true, only TLS v1 and newer will be used, SSLv3 will be disabled.We highly recommend to set this to true, if possible. This is currently a no-op on the default implementation and only used in the Android implementation!
 */
public OkHttpClient getNewOkHttpClient(boolean customssl,boolean tls_only,boolean allCipherSuites){
  OkHttpClient.Builder builder=new OkHttpClient.Builder();
  CookieManager cookieManager=new CookieManager();
  cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
  builder.cookieJar(new JavaNetCookieJar(cookieManager));
  builder.addNetworkInterceptor(new CustomRedirectInterceptor());
  if (customssl && ssl_store_path != null) {
    try {
      if (trust_store == null) {
        trust_store=getKeyStore();
      }
      X509TrustManager trustManager=new AdditionalKeyStoresSSLSocketFactory.AdditionalKeyStoresTrustManager(trust_store);
      SSLSocketFactory sf=AdditionalKeyStoresSSLSocketFactory.createForOkHttp(trustManager);
      builder.sslSocketFactory(sf,trustManager);
      List<ConnectionSpec> connectionSpecs=new ArrayList<ConnectionSpec>();
      connectionSpecs.add(ConnectionSpec.MODERN_TLS);
      connectionSpecs.add(new ConnectionSpec.Builder(ConnectionSpec.COMPATIBLE_TLS).allEnabledCipherSuites().build());
      if (!tls_only) {
        connectionSpecs.add(new ConnectionSpec.Builder(ConnectionSpec.COMPATIBLE_TLS).tlsVersions(TlsVersion.SSL_3_0,TlsVersion.TLS_1_0).allEnabledCipherSuites().build());
      }
 else       if (allCipherSuites) {
        connectionSpecs.add(new ConnectionSpec.Builder(ConnectionSpec.COMPATIBLE_TLS).allEnabledCipherSuites().build());
      }
      connectionSpecs.add(ConnectionSpec.CLEARTEXT);
      builder.connectionSpecs(connectionSpecs);
      return builder.build();
    }
 catch (    Exception e) {
      e.printStackTrace();
      return builder.build();
    }
  }
 else {
    return builder.build();
  }
}