content: package okhttp3;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collection;
  import java.util.List;
  import java.util.Objects;
  import javax.net.ssl.SSLSocket;
  import kotlin.Deprecated;
  import kotlin.DeprecationLevel;
  import kotlin.Metadata;
  import kotlin.ReplaceWith;
  import kotlin.collections.CollectionsKt;
  import kotlin.comparisons.ComparisonsKt;
  import kotlin.jvm.internal.DefaultConstructorMarker;
  import kotlin.jvm.internal.Intrinsics;
  import mt.Log1F380D;
  import okhttp3.internal.Util;
  
  @Metadata(bv = {1, 0, 3}, d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0002\b\t\u0018\u0000 $2\u00020\u0001:\u0002#$B7\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\u000e\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0007\u0018\u00010\u0006\u0012\u000e\u0010\b\u001a\n\u0012\u0004\u0012\u00020\u0007\u0018\u00010\u0006¢\u0006\u0002\u0010\tJ\u001d\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u0003H\u0000¢\u0006\u0002\b\u0017J\u0015\u0010\n\u001a\n\u0012\u0004\u0012\u00020\f\u0018\u00010\u000bH\u0007¢\u0006\u0002\b\u0018J\u0013\u0010\u0019\u001a\u00020\u00032\b\u0010\u001a\u001a\u0004\u0018\u00010\u0001H\u0002J\b\u0010\u001b\u001a\u00020\u001cH\u0016J\u000e\u0010\u001d\u001a\u00020\u00032\u0006\u0010\u001e\u001a\u00020\u0015J\u0018\u0010\u001f\u001a\u00020\u00002\u0006\u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u0003H\u0002J\r\u0010\u0004\u001a\u00020\u0003H\u0007¢\u0006\u0002\b J\u0015\u0010\u0010\u001a\n\u0012\u0004\u0012\u00020\u0011\u0018\u00010\u000bH\u0007¢\u0006\u0002\b!J\b\u0010\"\u001a\u00020\u0007H\u0016R\u0019\u0010\n\u001a\n\u0012\u0004\u0012\u00020\f\u0018\u00010\u000b8G¢\u0006\u0006\u001a\u0004\b\n\u0010\rR\u0018\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0007\u0018\u00010\u0006X\u0004¢\u0006\u0004\n\u0002\u0010\u000eR\u0013\u0010\u0002\u001a\u00020\u00038\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u000fR\u0013\u0010\u0004\u001a\u00020\u00038\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0004\u0010\u000fR\u0019\u0010\u0010\u001a\n\u0012\u0004\u0012\u00020\u0011\u0018\u00010\u000b8G¢\u0006\u0006\u001a\u0004\b\u0010\u0010\rR\u0018\u0010\b\u001a\n\u0012\u0004\u0012\u00020\u0007\u0018\u00010\u0006X\u0004¢\u0006\u0004\n\u0002\u0010\u000e¨\u0006%"}, d2 = {"Lokhttp3/ConnectionSpec;", "", "isTls", "", "supportsTlsExtensions", "cipherSuitesAsString", "", "", "tlsVersionsAsString", "(ZZ[Ljava/lang/String;[Ljava/lang/String;)V", "cipherSuites", "", "Lokhttp3/CipherSuite;", "()Ljava/util/List;", "[Ljava/lang/String;", "()Z", "tlsVersions", "Lokhttp3/TlsVersion;", "apply", "", "sslSocket", "Ljavax/net/ssl/SSLSocket;", "isFallback", "apply$okhttp", "-deprecated_cipherSuites", "equals", "other", "hashCode", "", "isCompatible", "socket", "supportedSpec", "-deprecated_supportsTlsExtensions", "-deprecated_tlsVersions", "toString", "Builder", "Companion", "okhttp"}, k = 1, mv = {1, 4, 0})
  /* compiled from: 01B3 */
  public final class ConnectionSpec {
      private static final CipherSuite[] APPROVED_CIPHER_SUITES;
      public static final ConnectionSpec CLEARTEXT = new Builder(false).build();
      public static final ConnectionSpec COMPATIBLE_TLS;
      public static final Companion Companion = new Companion((DefaultConstructorMarker) null);
      public static final ConnectionSpec MODERN_TLS;
      private static final CipherSuite[] RESTRICTED_CIPHER_SUITES;
      public static final ConnectionSpec RESTRICTED_TLS;
      /* access modifiers changed from: private */
      public final String[] cipherSuitesAsString;
      private final boolean isTls;
      private final boolean supportsTlsExtensions;
      /* access modifiers changed from: private */
      public final String[] tlsVersionsAsString;
  
      @Metadata(bv = {1, 0, 3}, d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u00002\u00020\u0001B\u000f\b\u0010\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004B\u000f\b\u0016\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0006\u0010\u0019\u001a\u00020\u0000J\u0006\u0010\u001a\u001a\u00020\u0000J\u0006\u0010\u001b\u001a\u00020\u0006J\u001f\u0010\b\u001a\u00020\u00002\u0012\u0010\b\u001a\n\u0012\u0006\b\u0001\u0012\u00020\n0\t\"\u00020\n¢\u0006\u0002\u0010\u001cJ\u001f\u0010\b\u001a\u00020\u00002\u0012\u0010\b\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u001d0\t\"\u00020\u001d¢\u0006\u0002\u0010\u001eJ\u0010\u0010\u0010\u001a\u00020\u00002\u0006\u0010\u0010\u001a\u00020\u0003H\u0007J\u001f\u0010\u0016\u001a\u00020\u00002\u0012\u0010\u0016\u001a\n\u0012\u0006\b\u0001\u0012\u00020\n0\t\"\u00020\n¢\u0006\u0002\u0010\u001cJ\u001f\u0010\u0016\u001a\u00020\u00002\u0012\u0010\u0016\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u001f0\t\"\u00020\u001f¢\u0006\u0002\u0010 R$\u0010\b\u001a\n\u0012\u0004\u0012\u00020\n\u0018\u00010\tX\u000e¢\u0006\u0010\n\u0002\u0010\u000f\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u001a\u0010\u0010\u001a\u00020\u0003X\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0004R\u001a\u0010\u0002\u001a\u00020\u0003X\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0014\u0010\u0012\"\u0004\b\u0015\u0010\u0004R$\u0010\u0016\u001a\n\u0012\u0004\u0012\u00020\n\u0018\u00010\tX\u000e¢\u0006\u0010\n\u0002\u0010\u000f\u001a\u0004\b\u0017\u0010\f\"\u0004\b\u0018\u0010\u000e¨\u0006!"}, d2 = {"Lokhttp3/ConnectionSpec$Builder;", "", "tls", "", "(Z)V", "connectionSpec", "Lokhttp3/ConnectionSpec;", "(Lokhttp3/ConnectionSpec;)V", "cipherSuites", "", "", "getCipherSuites$okhttp", "()[Ljava/lang/String;", "setCipherSuites$okhttp", "([Ljava/lang/String;)V", "[Ljava/lang/String;", "supportsTlsExtensions", "getSupportsTlsExtensions$okhttp", "()Z", "setSupportsTlsExtensions$okhttp", "getTls$okhttp", "setTls$okhttp", "tlsVersions", "getTlsVersions$okhttp", "setTlsVersions$okhttp", "allEnabledCipherSuites", "allEnabledTlsVersions", "build", "([Ljava/lang/String;)Lokhttp3/ConnectionSpec$Builder;", "Lokhttp3/CipherSuite;", "([Lokhttp3/CipherSuite;)Lokhttp3/ConnectionSpec$Builder;", "Lokhttp3/TlsVersion;", "([Lokhttp3/TlsVersion;)Lokhttp3/ConnectionSpec$Builder;", "okhttp"}, k = 1, mv = {1, 4, 0})
      /* compiled from: ConnectionSpec.kt */
      public static final class Builder {
          private String[] cipherSuites;
          private boolean supportsTlsExtensions;
          private boolean tls;
          private String[] tlsVersions;
  
          public Builder(ConnectionSpec connectionSpec) {
              Intrinsics.checkNotNullParameter(connectionSpec, "connectionSpec");
              this.tls = connectionSpec.isTls();
              this.cipherSuites = connectionSpec.cipherSuitesAsString;
              this.tlsVersions = connectionSpec.tlsVersionsAsString;
              this.supportsTlsExtensions = connectionSpec.supportsTlsExtensions();
          }
  
          public Builder(boolean tls2) {
              this.tls = tls2;
          }
  
          public final Builder allEnabledCipherSuites() {
              Builder builder = this;
              if (builder.tls) {
                  String[] strArr = null;
                  builder.cipherSuites = null;
                  return this;
              }
              throw new IllegalArgumentException("no cipher suites for cleartext connections".toString());
          }
  
          public final Builder allEnabledTlsVersions() {
              Builder builder = this;
              if (builder.tls) {
                  String[] strArr = null;
                  builder.tlsVersions = null;
                  return this;
              }
              throw new IllegalArgumentException("no TLS versions for cleartext connections".toString());
          }
  
          public final ConnectionSpec build() {
              return new ConnectionSpec(this.tls, this.supportsTlsExtensions, this.cipherSuites, this.tlsVersions);
          }
  
          public final Builder cipherSuites(String... cipherSuites2) {
              Intrinsics.checkNotNullParameter(cipherSuites2, "cipherSuites");
              Builder builder = this;
              if (builder.tls) {
                  if (!(cipherSuites2.length == 0)) {
                      Object clone = cipherSuites2.clone();
                      if (clone != null) {
                          builder.cipherSuites = (String[]) clone;
                          return this;
                      }
                      throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<kotlin.String>");
                  }
                  throw new IllegalArgumentException("At least one cipher suite is required".toString());
              }
              throw new IllegalArgumentException("no cipher suites for cleartext connections".toString());
          }
  
          public final Builder cipherSuites(CipherSuite... cipherSuites2) {
              Intrinsics.checkNotNullParameter(cipherSuites2, "cipherSuites");
              Builder builder = this;
              if (builder.tls) {
                  CipherSuite[] cipherSuiteArr = cipherSuites2;
                  Collection arrayList = new ArrayList(cipherSuiteArr.length);
                  for (CipherSuite javaName : cipherSuiteArr) {
                      arrayList.add(javaName.javaName());
                  }
                  Object[] array = ((List) arrayList).toArray(new String[0]);
                  if (array != null) {
                      String[] strArr = (String[]) array;
                      return builder.cipherSuites((String[]) Arrays.copyOf(strArr, strArr.length));
                  }
                  throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
              }
              throw new IllegalArgumentException("no cipher suites for cleartext connections".toString());
          }
  
          public final String[] getCipherSuites$okhttp() {
              return this.cipherSuites;
          }
  
          public final boolean getSupportsTlsExtensions$okhttp() {
              return this.supportsTlsExtensions;
          }
  
          public final boolean getTls$okhttp() {
              return this.tls;
          }
  
          public final String[] getTlsVersions$okhttp() {
              return this.tlsVersions;
          }
  
          public final void setCipherSuites$okhttp(String[] strArr) {
              this.cipherSuites = strArr;
          }
  
          public final void setSupportsTlsExtensions$okhttp(boolean z) {
              this.supportsTlsExtensions = z;
          }
  
          public final void setTls$okhttp(boolean z) {
              this.tls = z;
          }
  
          public final void setTlsVersions$okhttp(String[] strArr) {
              this.tlsVersions = strArr;
          }
  
          @Deprecated(message = "since OkHttp 3.13 all TLS-connections are expected to support TLS extensions.\nIn a future release setting this to true will be unnecessary and setting it to false\nwill have no effect.")
          public final Builder supportsTlsExtensions(boolean supportsTlsExtensions2) {
              Builder builder = this;
              if (builder.tls) {
                  builder.supportsTlsExtensions = supportsTlsExtensions2;
                  return this;
              }
              throw new IllegalArgumentException("no TLS extensions for cleartext connections".toString());
          }
  
          public final Builder tlsVersions(String... tlsVersions2) {
              Intrinsics.checkNotNullParameter(tlsVersions2, "tlsVersions");
              Builder builder = this;
              if (builder.tls) {
                  if (!(tlsVersions2.length == 0)) {
                      Object clone = tlsVersions2.clone();
                      if (clone != null) {
                          builder.tlsVersions = (String[]) clone;
                          return this;
                      }
                      throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<kotlin.String>");
                  }
                  throw new IllegalArgumentException("At least one TLS version is required".toString());
              }
              throw new IllegalArgumentException("no TLS versions for cleartext connections".toString());
          }
  
          public final Builder tlsVersions(TlsVersion... tlsVersions2) {
              Intrinsics.checkNotNullParameter(tlsVersions2, "tlsVersions");
              Builder builder = this;
              if (builder.tls) {
                  TlsVersion[] tlsVersionArr = tlsVersions2;
                  Collection arrayList = new ArrayList(tlsVersionArr.length);
                  for (TlsVersion javaName : tlsVersionArr) {
                      arrayList.add(javaName.javaName());
                  }
                  Object[] array = ((List) arrayList).toArray(new String[0]);
                  if (array != null) {
                      String[] strArr = (String[]) array;
                      return builder.tlsVersions((String[]) Arrays.copyOf(strArr, strArr.length));
                  }
                  throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
              }
              throw new IllegalArgumentException("no TLS versions for cleartext connections".toString());
          }
      }
  
      @Metadata(bv = {1, 0, 3}, d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0016\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0004¢\u0006\u0004\n\u0002\u0010\u0006R\u0010\u0010\u0007\u001a\u00020\b8\u0006X\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u00020\b8\u0006X\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\n\u001a\u00020\b8\u0006X\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0004¢\u0006\u0004\n\u0002\u0010\u0006R\u0010\u0010\f\u001a\u00020\b8\u0006X\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lokhttp3/ConnectionSpec$Companion;", "", "()V", "APPROVED_CIPHER_SUITES", "", "Lokhttp3/CipherSuite;", "[Lokhttp3/CipherSuite;", "CLEARTEXT", "Lokhttp3/ConnectionSpec;", "COMPATIBLE_TLS", "MODERN_TLS", "RESTRICTED_CIPHER_SUITES", "RESTRICTED_TLS", "okhttp"}, k = 1, mv = {1, 4, 0})
      /* compiled from: ConnectionSpec.kt */
      public static final class Companion {
          private Companion() {
          }
  
          public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
              this();
          }
      }
  
      static {
          CipherSuite[] cipherSuiteArr = {CipherSuite.TLS_AES_128_GCM_SHA256, CipherSuite.TLS_AES_256_GCM_SHA384, CipherSuite.TLS_CHACHA20_POLY1305_SHA256, CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, CipherSuite.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, CipherSuite.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256};
          RESTRICTED_CIPHER_SUITES = cipherSuiteArr;
          CipherSuite[] cipherSuiteArr2 = {CipherSuite.TLS_AES_128_GCM_SHA256, CipherSuite.TLS_AES_256_GCM_SHA384, CipherSuite.TLS_CHACHA20_POLY1305_SHA256, CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, CipherSuite.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, CipherSuite.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256, CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384, CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA, CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA, CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA};
          APPROVED_CIPHER_SUITES = cipherSuiteArr2;
          RESTRICTED_TLS = new Builder(true).cipherSuites((CipherSuite[]) Arrays.copyOf(cipherSuiteArr, cipherSuiteArr.length)).tlsVersions(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2).supportsTlsExtensions(true).build();
          MODERN_TLS = new Builder(true).cipherSuites((CipherSuite[]) Arrays.copyOf(cipherSuiteArr2, cipherSuiteArr2.length)).tlsVersions(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2).supportsTlsExtensions(true).build();
          COMPATIBLE_TLS = new Builder(true).cipherSuites((CipherSuite[]) Arrays.copyOf(cipherSuiteArr2, cipherSuiteArr2.length)).tlsVersions(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2, TlsVersion.TLS_1_1, TlsVersion.TLS_1_0).supportsTlsExtensions(true).build();
      }
  
      public ConnectionSpec(boolean isTls2, boolean supportsTlsExtensions2, String[] cipherSuitesAsString2, String[] tlsVersionsAsString2) {
          this.isTls = isTls2;
          this.supportsTlsExtensions = supportsTlsExtensions2;
          this.cipherSuitesAsString = cipherSuitesAsString2;
          this.tlsVersionsAsString = tlsVersionsAsString2;
      }
  
      private final ConnectionSpec supportedSpec(SSLSocket sslSocket, boolean isFallback) {
          String[] strArr;
          String[] strArr2;
          if (this.cipherSuitesAsString != null) {
              String[] enabledCipherSuites = sslSocket.getEnabledCipherSuites();
              Intrinsics.checkNotNullExpressionValue(enabledCipherSuites, "sslSocket.enabledCipherSuites");
              strArr = Util.intersect(enabledCipherSuites, this.cipherSuitesAsString, CipherSuite.Companion.getORDER_BY_NAME$okhttp());
          } else {
              strArr = sslSocket.getEnabledCipherSuites();
          }
          if (this.tlsVersionsAsString != null) {
              String[] enabledProtocols = sslSocket.getEnabledProtocols();
              Intrinsics.checkNotNullExpressionValue(enabledProtocols, "sslSocket.enabledProtocols");
              strArr2 = Util.intersect(enabledProtocols, this.tlsVersionsAsString, ComparisonsKt.naturalOrder());
          } else {
              strArr2 = sslSocket.getEnabledProtocols();
          }
          String[] supportedCipherSuites = sslSocket.getSupportedCipherSuites();
          Intrinsics.checkNotNullExpressionValue(supportedCipherSuites, "supportedCipherSuites");
          int indexOf = Util.indexOf(supportedCipherSuites, "TLS_FALLBACK_SCSV", CipherSuite.Companion.getORDER_BY_NAME$okhttp());
          if (isFallback && indexOf != -1) {
              Intrinsics.checkNotNullExpressionValue(strArr, "cipherSuitesIntersection");
              String str = supportedCipherSuites[indexOf];
              Intrinsics.checkNotNullExpressionValue(str, "supportedCipherSuites[indexOfFallbackScsv]");
              strArr = Util.concat(strArr, str);
          }
          Builder builder = new Builder(this);
          Intrinsics.checkNotNullExpressionValue(strArr, "cipherSuitesIntersection");
          Builder cipherSuites = builder.cipherSuites((String[]) Arrays.copyOf(strArr, strArr.length));
          Intrinsics.checkNotNullExpressionValue(strArr2, "tlsVersionsIntersection");
          return cipherSuites.tlsVersions((String[]) Arrays.copyOf(strArr2, strArr2.length)).build();
      }
  
      @Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "cipherSuites", imports = {}))
      /* renamed from: -deprecated_cipherSuites  reason: not valid java name */
      public final List<CipherSuite> m1617deprecated_cipherSuites() {
          return cipherSuites();
      }
  
      @Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "supportsTlsExtensions", imports = {}))
      /* renamed from: -deprecated_supportsTlsExtensions  reason: not valid java name */
      public final boolean m1618deprecated_supportsTlsExtensions() {
          return this.supportsTlsExtensions;
      }
  
      @Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "tlsVersions", imports = {}))
      /* renamed from: -deprecated_tlsVersions  reason: not valid java name */
      public final List<TlsVersion> m1619deprecated_tlsVersions() {
          return tlsVersions();
      }
  
      public final void apply$okhttp(SSLSocket sslSocket, boolean isFallback) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          ConnectionSpec supportedSpec = supportedSpec(sslSocket, isFallback);
          if (supportedSpec.tlsVersions() != null) {
              sslSocket.setEnabledProtocols(supportedSpec.tlsVersionsAsString);
          }
          if (supportedSpec.cipherSuites() != null) {
              sslSocket.setEnabledCipherSuites(supportedSpec.cipherSuitesAsString);
          }
      }
  
      public final List<CipherSuite> cipherSuites() {
          String[] strArr = this.cipherSuitesAsString;
          if (strArr == null) {
              return null;
          }
          Collection arrayList = new ArrayList(strArr.length);
          for (String forJavaName : strArr) {
              arrayList.add(CipherSuite.Companion.forJavaName(forJavaName));
          }
          return CollectionsKt.toList((List) arrayList);
      }
  
      public boolean equals(Object other) {
          if (!(other instanceof ConnectionSpec)) {
              return false;
          }
          if (other == this) {
              return true;
          }
          boolean z = this.isTls;
          if (z != ((ConnectionSpec) other).isTls) {
              return false;
          }
          return !z || (Arrays.equals(this.cipherSuitesAsString, ((ConnectionSpec) other).cipherSuitesAsString) && Arrays.equals(this.tlsVersionsAsString, ((ConnectionSpec) other).tlsVersionsAsString) && this.supportsTlsExtensions == ((ConnectionSpec) other).supportsTlsExtensions);
      }
  
      public int hashCode() {
          if (!this.isTls) {
              return 17;
          }
          int i = 17 * 31;
          String[] strArr = this.cipherSuitesAsString;
          int i2 = 0;
          int hashCode = (i + (strArr != null ? Arrays.hashCode(strArr) : 0)) * 31;
          String[] strArr2 = this.tlsVersionsAsString;
          if (strArr2 != null) {
              i2 = Arrays.hashCode(strArr2);
          }
          return ((hashCode + i2) * 31) + (this.supportsTlsExtensions ^ true ? 1 : 0);
      }
  
      public final boolean isCompatible(SSLSocket socket) {
          Intrinsics.checkNotNullParameter(socket, "socket");
          if (!this.isTls) {
              return false;
          }
          String[] strArr = this.tlsVersionsAsString;
          if (strArr != null && !Util.hasIntersection(strArr, socket.getEnabledProtocols(), ComparisonsKt.naturalOrder())) {
              return false;
          }
          String[] strArr2 = this.cipherSuitesAsString;
          return strArr2 == null || Util.hasIntersection(strArr2, socket.getEnabledCipherSuites(), CipherSuite.Companion.getORDER_BY_NAME$okhttp());
      }
  
      public final boolean isTls() {
          return this.isTls;
      }
  
      public final boolean supportsTlsExtensions() {
          return this.supportsTlsExtensions;
      }
  
      public final List<TlsVersion> tlsVersions() {
          String[] strArr = this.tlsVersionsAsString;
          if (strArr == null) {
              return null;
          }
          Collection arrayList = new ArrayList(strArr.length);
          for (String forJavaName : strArr) {
              arrayList.add(TlsVersion.Companion.forJavaName(forJavaName));
          }
          return CollectionsKt.toList((List) arrayList);
      }
  
      public String toString() {
          if (!this.isTls) {
              return "ConnectionSpec()";
          }
          StringBuilder append = new StringBuilder().append("ConnectionSpec(").append("cipherSuites=");
          String objects = Objects.toString(cipherSuites(), "[all enabled]");
          Log1F380D.a((Object) objects);
          StringBuilder append2 = append.append(objects).append(", ").append("tlsVersions=");
          String objects2 = Objects.toString(tlsVersions(), "[all enabled]");
          Log1F380D.a((Object) objects2);
          return append2.append(objects2).append(", ").append("supportsTlsExtensions=").append(this.supportsTlsExtensions).append(')').toString();
      }
  }
  