I have some difficulties with using ssl on Android 2.2 My custom Http client for ssl work finly on earlier and older versions of Android, but on 2.2 https requests don't run att all. Here my code:
public class SSLHttpClient extends DefaultHttpClient {
final Context context;
public SSLHttpClient(Context context,HttpParams params) {
super(params);
this.context = context;
}
@Override
protected ClientConnectionManager createClientConnectionManager() {
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("http", PlainSocketFactory
.getSocketFactory(), 80));
registry.register(new Scheme("https", newSslSocketFactory(), 443));
return new SingleClientConnManager(getParams(), registry);
}
private SSLSocketFactory newSslSocketFactory() {
try {
SSLSocketFactory sf = new SSLSocketFactory(keyStore,"",trustStore);
//---------some code--------------------------------------
return sf;
} catch (Exception e) {
throw new AssertionError(e);
}
}
}
I found some similar articles but they didn't solve my problem. Maybe somebody faced with such problem. Thanks in advance......