// Path: src/android/com/silkimen/http/TLSConfiguration.java
// public class TLSConfiguration {
//   private TrustManager[] trustManagers = null;
//   private KeyManager[] keyManagers = null;
//   private HostnameVerifier hostnameVerifier = null;
//   private String[] blacklistedProtocols = {};
// 
//   private SSLSocketFactory socketFactory;
// 
//   public void setHostnameVerifier(HostnameVerifier hostnameVerifier) {
//     this.hostnameVerifier = hostnameVerifier;
//   }
// 
//   public void setKeyManagers(KeyManager[] keyManagers) {
//     this.keyManagers = keyManagers;
//     this.socketFactory = null;
//   }
// 
//   public void setTrustManagers(TrustManager[] trustManagers) {
//     this.trustManagers = trustManagers;
//     this.socketFactory = null;
//   }
// 
//   public void setBlacklistedProtocols(String[] protocols) {
//     this.blacklistedProtocols = protocols;
//     this.socketFactory = null;
//   }
// 
//   public HostnameVerifier getHostnameVerifier() {
//     return this.hostnameVerifier;
//   }
// 
//   public SSLSocketFactory getTLSSocketFactory() throws IOException {
//     if (this.socketFactory != null) {
//       return this.socketFactory;
//     }
// 
//     try {
//       SSLContext context = SSLContext.getInstance("TLS");
// 
//       context.init(this.keyManagers, this.trustManagers, new SecureRandom());
//       this.socketFactory = new TLSSocketFactory(context, this.blacklistedProtocols);
// 
//       return this.socketFactory;
//     } catch (GeneralSecurityException e) {
//       IOException ioException = new IOException("Security exception occured while configuring TLS context");
//       ioException.initCause(e);
//       throw ioException;
//     }
//   }
// }


import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import com.silkimen.http.TLSConfiguration;
import org.apache.cordova.CallbackContext;
import android.app.Activity;
import android.util.Log;
import android.content.res.AssetManager;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
package com.silkimen.cordovahttp;






class CordovaServerTrust implements Runnable {
  private static final String TAG = "Cordova-Plugin-HTTP";

  private final TrustManager[] noOpTrustManagers;
  private final HostnameVerifier noOpVerifier;

  private String mode;
  private Activity activity;
// Path: src/android/com/silkimen/http/TLSConfiguration.java
// public class TLSConfiguration {
//   private TrustManager[] trustManagers = null;
//   private KeyManager[] keyManagers = null;
//   private HostnameVerifier hostnameVerifier = null;
//   private String[] blacklistedProtocols = {};
// 
//   private SSLSocketFactory socketFactory;
// 
//   public void setHostnameVerifier(HostnameVerifier hostnameVerifier) {
//     this.hostnameVerifier = hostnameVerifier;
//   }
// 
//   public void setKeyManagers(KeyManager[] keyManagers) {
//     this.keyManagers = keyManagers;
//     this.socketFactory = null;
//   }
// 
//   public void setTrustManagers(TrustManager[] trustManagers) {
//     this.trustManagers = trustManagers;
//     this.socketFactory = null;
//   }
// 
//   public void setBlacklistedProtocols(String[] protocols) {
//     this.blacklistedProtocols = protocols;
//     this.socketFactory = null;
//   }
// 
//   public HostnameVerifier getHostnameVerifier() {
//     return this.hostnameVerifier;
//   }
// 
//   public SSLSocketFactory getTLSSocketFactory() throws IOException {
//     if (this.socketFactory != null) {
//       return this.socketFactory;
//     }
// 
//     try {
//       SSLContext context = SSLContext.getInstance("TLS");
// 
//       context.init(this.keyManagers, this.trustManagers, new SecureRandom());
//       this.socketFactory = new TLSSocketFactory(context, this.blacklistedProtocols);
// 
//       return this.socketFactory;
//     } catch (GeneralSecurityException e) {
//       IOException ioException = new IOException("Security exception occured while configuring TLS context");
//       ioException.initCause(e);
//       throw ioException;
//     }
//   }
// }


// Path: src/android/com/silkimen/cordovahttp/CordovaServerTrust.java
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import com.silkimen.http.TLSConfiguration;
import org.apache.cordova.CallbackContext;
import android.app.Activity;
import android.util.Log;
import android.content.res.AssetManager;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;

package com.silkimen.cordovahttp;






class CordovaServerTrust implements Runnable {
  private static final String TAG = "Cordova-Plugin-HTTP";

  private final TrustManager[] noOpTrustManagers;
  private final HostnameVerifier noOpVerifier;

  private String mode;
  private Activity activity;
  private TLSConfiguration tlsConfiguration;