congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AdvancedX509TrustManager.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.owncloud.android.lib.common.network.AdvancedX509TrustManager
constructor

Best Java code snippets using com.owncloud.android.lib.common.network.AdvancedX509TrustManager.<init> (Showing top 2 results out of 315)

origin: nextcloud/android-library

public static AdvancedSslSocketFactory getAdvancedSslSocketFactory(Context context) 
    throws GeneralSecurityException, IOException {
  if (mAdvancedSslSocketFactory  == null) {
    KeyStore trustStore = getKnownServersStore(context);
    AdvancedX509TrustManager trustMgr = new AdvancedX509TrustManager(trustStore);
    TrustManager[] tms = new TrustManager[] { trustMgr };
      
    SSLContext sslContext;
    try {
      sslContext = SSLContext.getInstance("TLSv1.2");
    } catch (NoSuchAlgorithmException e) {
      Log_OC.w(TAG, "TLSv1.2 is not supported in this device; falling through TLSv1.0");
      sslContext = SSLContext.getInstance("TLSv1");
      // should be available in any device; see reference of supported protocols in 
      // http://developer.android.com/reference/javax/net/ssl/SSLSocket.html
    }
    sslContext.init(null, tms, null);
        
    mHostnameVerifier = new BrowserCompatHostnameVerifier();
    mAdvancedSslSocketFactory = new AdvancedSslSocketFactory(sslContext, trustMgr, mHostnameVerifier);
  }
  return mAdvancedSslSocketFactory;
}
origin: owncloud/android-library

public static OkHttpClient getOkHttpClient() {
  if (sOkHttpClient == null) {
    try {
      final X509TrustManager trustManager = new AdvancedX509TrustManager(
          NetworkUtils.getKnownServersStore(sContext));
      final SSLContext sslContext = SSLContext.getInstance("TLS");
com.owncloud.android.lib.common.networkAdvancedX509TrustManager<init>

Javadoc

Constructor for AdvancedX509TrustManager

Popular methods of AdvancedX509TrustManager

  • findX509TrustManager
    Locates the first X509TrustManager provided by a given TrustManagerFactory
  • isKnownServer

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Notification (javax.management)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now