package io.netty.handler.ssl;

import java.security.cert.CertificateException;

/* JADX INFO: loaded from: classes.dex */
public final class OpenSslCertificateException extends CertificateException {
    private static final long serialVersionUID = 5542675253797129798L;
    private final int errorCode;

    public OpenSslCertificateException(int i2) {
        this((String) null, i2);
    }

    private static int checkErrorCode(int i2) {
        if (i2 < 0 || i2 > 65) {
            throw new IllegalArgumentException("errorCode must be 0 => 65. See https://www.openssl.org/docs/manmaster/apps/verify.html .");
        }
        return i2;
    }

    public int errorCode() {
        return this.errorCode;
    }

    public OpenSslCertificateException(String str, int i2) {
        super(str);
        this.errorCode = checkErrorCode(i2);
    }

    public OpenSslCertificateException(String str, Throwable th, int i2) {
        super(str, th);
        this.errorCode = checkErrorCode(i2);
    }

    public OpenSslCertificateException(Throwable th, int i2) {
        this(null, th, i2);
    }
}
