package com.chartboost.sdk.impl;

import android.os.Build;
import com.chartboost.sdk.internal.Networking.NetworkHelper;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public abstract class k2 {

    /* renamed from: a  reason: collision with root package name */
    public static final a f1738a = new a(null);

    /* loaded from: classes2.dex */
    public static final class a {
        public final SSLSocketFactory a() {
            SSLContext sSLContext;
            if (Build.VERSION.SDK_INT >= 29) {
                sSLContext = SSLContext.getInstance("TLSv1.3");
            } else {
                sSLContext = SSLContext.getInstance("TLSv1.2");
            }
            if (NetworkHelper.a()) {
                sSLContext.init(null, new X509TrustManager[]{l9.c()}, null);
            } else {
                sSLContext.init(null, null, null);
            }
            sSLContext.createSSLEngine();
            SSLSocketFactory socketFactory = sSLContext.getSocketFactory();
            Intrinsics.checkNotNullExpressionValue(socketFactory, "getSocketFactory(...)");
            return socketFactory;
        }

        public a() {
        }

        public /* synthetic */ a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }
    }

    public static final SSLSocketFactory a() {
        return f1738a.a();
    }
}
