SNI support for Android: how to apply the fix?

i’m experiencing this error with my Android project: No peer certificate and i’m trying to fix it following this workaround.

I would add this class in my Eclipse project but it gives me errors about some imports (the ones with asterisk):

import android.os.Build;
import android.util.Log;
*import org.apache.commons.lang3.StringUtils;
*import org.apache.http.conn.ssl.BrowserCompatHostnameVerifierHC4;
*import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
*import lombok.Cleanup;

The errors are like this: The import org.apache.http.conn.ssl.SSLConnectionSocketFactory cannot be resolved

Can you tell me how to fix this?

Source: eclipse

Leave a Reply