package okhttp3;

import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Lambda;
import okhttp3.n0.tls.CertificateChainCleaner;

/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "", "Ljava/security/cert/X509Certificate;", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
public final class i extends Lambda implements Function0<List<? extends X509Certificate>> {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ CertificatePinner f9638f;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ List<Certificate> f9639m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final /* synthetic */ String f9640n;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public i(CertificatePinner certificatePinner, List<? extends Certificate> list, String str) {
        super(0);
        this.f9638f = certificatePinner;
        this.f9639m = list;
        this.f9640n = str;
    }

    @Override // kotlin.jvm.functions.Function0
    public List<? extends X509Certificate> invoke() {
        CertificateChainCleaner certificateChainCleaner = this.f9638f.f9634d;
        List<Certificate> listA = certificateChainCleaner == null ? null : certificateChainCleaner.a(this.f9639m, this.f9640n);
        if (listA == null) {
            listA = this.f9639m;
        }
        ArrayList arrayList = new ArrayList(g.h.a.i.H(listA, 10));
        Iterator<T> it = listA.iterator();
        while (it.hasNext()) {
            arrayList.add((X509Certificate) ((Certificate) it.next()));
        }
        return arrayList;
    }
}
