package o4;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.Provider;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;

/* JADX INFO: loaded from: classes3.dex */
public final class i extends l {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Method f21858e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final Method f21859f;

    public i(Provider provider, Method method, Method method2) {
        super(provider);
        this.f21858e = method;
        this.f21859f = method2;
    }

    @Override // o4.l
    public final void c(SSLSocket sSLSocket, String str, List list) {
        SSLParameters sSLParameters = sSLSocket.getSSLParameters();
        ArrayList arrayList = new ArrayList(list.size());
        Iterator it = list.iterator();
        while (it.hasNext()) {
            m mVar = (m) it.next();
            if (mVar != m.HTTP_1_0) {
                arrayList.add(mVar.f21877a);
            }
        }
        try {
            this.f21858e.invoke(sSLParameters, arrayList.toArray(new String[arrayList.size()]));
            sSLSocket.setSSLParameters(sSLParameters);
        } catch (IllegalAccessException e6) {
            throw new RuntimeException(e6);
        } catch (InvocationTargetException e7) {
            throw new RuntimeException(e7);
        }
    }

    @Override // o4.l
    public final String d(SSLSocket sSLSocket) {
        try {
            return (String) this.f21859f.invoke(sSLSocket, new Object[0]);
        } catch (IllegalAccessException e6) {
            throw new RuntimeException(e6);
        } catch (InvocationTargetException e7) {
            throw new RuntimeException(e7);
        }
    }

    @Override // o4.l
    public final int e() {
        return 1;
    }
}
