    protected AbstractHttpClient http() {
        if(null == http) {
            final HttpParams params = new BasicHttpParams();
            HttpProtocolParams.setVersion(params, org.apache.http.HttpVersion.HTTP_1_1);
            HttpProtocolParams.setContentCharset(params, getEncoding());
            HttpProtocolParams.setUserAgent(params, getUserAgent());
            AuthParams.setCredentialCharset(params, "ISO-8859-1");
            HttpConnectionParams.setTcpNoDelay(params, true);
            HttpConnectionParams.setSoTimeout(params, timeout());
            HttpConnectionParams.setSocketBufferSize(params, 8192);
            HttpClientParams.setRedirecting(params, true);
            HttpClientParams.setAuthenticating(params, true);
            SchemeRegistry registry = new SchemeRegistry();
            if(host.getProtocol().isSecure()) {
                org.apache.http.conn.ssl.SSLSocketFactory factory = new SSLSocketFactory(
                        new CustomTrustSSLProtocolSocketFactory(this.getTrustManager()).getSSLContext());
                factory.setHostnameVerifier(org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
                registry.register(
                        new Scheme(host.getProtocol().getScheme(), factory, host.getPort()));
            }
            else {
                registry.register(
                        new Scheme(host.getProtocol().getScheme(), PlainSocketFactory.getSocketFactory(), host.getPort()));
            }
            if("https".equals(this.getHost().getProtocol().getScheme())) {
                if(Preferences.instance().getBoolean("connection.proxy.enable")) {
                    final Proxy proxy = ProxyFactory.instance();
                    if(proxy.isHTTPSProxyEnabled(host)) {
                        ConnRouteParams.setDefaultProxy(params, new HttpHost(proxy.getHTTPSProxyHost(), proxy.getHTTPSProxyPort()));
                    }
                }
            }
            else if("http".equals(this.getHost().getProtocol().getScheme())) {
                if(Preferences.instance().getBoolean("connection.proxy.enable")) {
                    final Proxy proxy = ProxyFactory.instance();
                    if(proxy.isHTTPProxyEnabled(host)) {
                        ConnRouteParams.setDefaultProxy(params, new HttpHost(proxy.getHTTPProxyHost(), proxy.getHTTPProxyPort()));
                    }
                }
            }
            ClientConnectionManager manager = new SingleClientConnManager(params, registry);
            http = new DefaultHttpClient(manager, params);
            this.configure(http);
        }
        return http;
    }

    protected AbstractHttpClient http() {
        if(null == http) {
            final HttpParams params = new BasicHttpParams();
            HttpProtocolParams.setVersion(params, org.apache.http.HttpVersion.HTTP_1_1);
            HttpProtocolParams.setContentCharset(params, getEncoding());
            HttpProtocolParams.setUserAgent(params, getUserAgent());
            AuthParams.setCredentialCharset(params, "ISO-8859-1");
            HttpConnectionParams.setTcpNoDelay(params, true);
            HttpConnectionParams.setSoTimeout(params, timeout());
            HttpConnectionParams.setSocketBufferSize(params, 8192);
            HttpClientParams.setRedirecting(params, true);
            HttpClientParams.setAuthenticating(params, true);
            SchemeRegistry registry = new SchemeRegistry();
            registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), host.getPort()));
            if("https".equals(this.getHost().getProtocol().getScheme())) {
                org.apache.http.conn.ssl.SSLSocketFactory factory = new SSLSocketFactory(
                        new CustomTrustSSLProtocolSocketFactory(this.getTrustManager()).getSSLContext());
                factory.setHostnameVerifier(org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
                registry.register(new Scheme(host.getProtocol().getScheme(), factory, host.getPort()));
            }
            if(Preferences.instance().getBoolean("connection.proxy.enable")) {
                final Proxy proxy = ProxyFactory.instance();
                if("https".equals(this.getHost().getProtocol().getScheme())) {
                    if(proxy.isHTTPSProxyEnabled(host)) {
                        ConnRouteParams.setDefaultProxy(params, new HttpHost(proxy.getHTTPSProxyHost(), proxy.getHTTPSProxyPort()));
                    }
                }
                if("http".equals(this.getHost().getProtocol().getScheme())) {
                    if(proxy.isHTTPProxyEnabled(host)) {
                        ConnRouteParams.setDefaultProxy(params, new HttpHost(proxy.getHTTPProxyHost(), proxy.getHTTPProxyPort()));
                    }
                }
            }
            ClientConnectionManager manager = new SingleClientConnManager(params, registry);
            http = new DefaultHttpClient(manager, params);
            this.configure(http);
        }
        return http;
    }
