private static HttpClient getHttpClient() {
        try {
            if (httpClient != null) {
                return httpClient;
            }            
            
            ConnectionKeepAliveStrategy myStrategy = new ConnectionKeepAliveStrategy()  {
                public long getKeepAliveDuration(HttpResponse response, HttpContext context) {
                    // Honor 'keep-alive' header
                    HeaderElementIterator it = new BasicHeaderElementIterator(
                            response.headerIterator(HTTP.CONN_KEEP_ALIVE));
                    while (it.hasNext()) {
                        HeaderElement he = it.nextElement();
                        String param = he.getName();
                        String value = he.getValue();
                        if (value != null && param.equalsIgnoreCase("timeout")) {
                            try {
                                logger.info("服务端的保持连接时常:"+value);
                                return Long.parseLong(value) * 1000;
                            } catch(NumberFormatException ignore) {
                            }
                        }
                    }
                    return 300 * 1000;
                }
            };
            
            
           PoolingHttpClientConnectionManager connManager = null;      
           try {
               SSLContext sslContext = SSLContexts.custom().useTLS().build();
               sslContext.init(null,
                       new TrustManager[] { new X509TrustManager() {                     
                            
                           public X509Certificate[] getAcceptedIssuers() {
                               return null;
                           }
    
                           public void checkClientTrusted(
                                   X509Certificate[] certs, String authType) {
                           }
    
                           public void checkServerTrusted(
                                   X509Certificate[] certs, String authType) {
                           }
                       }}, null);
               Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
                       .register("http", PlainConnectionSocketFactory.INSTANCE)
                       .register("https", new SSLConnectionSocketFactory(sslContext))
                       .build();
                
               connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
               httpClient = HttpClients.custom().setConnectionManager(connManager).setKeepAliveStrategy(myStrategy).build();
               // Create socket configuration
               SocketConfig socketConfig = SocketConfig.custom().setTcpNoDelay(true).build();
               connManager.setDefaultSocketConfig(socketConfig);
               // Create message constraints
               MessageConstraints messageConstraints = MessageConstraints.custom()
                   .setMaxHeaderCount(200)
                   .setMaxLineLength(2000)
                   .build();
               // Create connection configuration
               ConnectionConfig connectionConfig = ConnectionConfig.custom()
                   .setMalformedInputAction(CodingErrorAction.IGNORE)
                   .setUnmappableInputAction(CodingErrorAction.IGNORE)
                   .setCharset(Consts.UTF_8)
                   .setMessageConstraints(messageConstraints)
                   .build();
               connManager.setDefaultConnectionConfig(connectionConfig);
               connManager.setMaxTotal(200);
               connManager.setDefaultMaxPerRoute(20);
           } catch (KeyManagementException e) {
               logger.info("KeyManagementException"+ e.getMessage());
           } catch (NoSuchAlgorithmException e) {
               logger.info("NoSuchAlgorithmException"+ e.getMessage());
           }

        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return httpClient;
    }