public void initializeConnectionManager() {

        if (initialized) {
           schemeRegistry = new SchemeRegistry();
           try {
               SSLContext ctx = SSLContext.getInstance("TLS");
               ctx.init(sslKeyManagers, sslTrustManagers, null);
               SSLSocketFactory sf = new SSLSocketFactory(ctx);
               scheme = new Scheme(baseURL.getProtocol(), basePort, sf);
               schemeRegistry.register(scheme);
           } catch (GeneralSecurityException e) {
               log.error("Error initializing CM: ", e);
           } catch (Exception e) {
               log.error("Error initializing CM: ", e);
           }
           connectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(),schemeRegistry);
           // connectionManager.setMaxTotalConnections(maxConnections);
  
           if (authenticationType==AUTHENTICATION_TYPE.BASIC) {
               if (username==null || password==null) {
                   log.error("rws basic auth requires user and password");
               }
           }
           if (authenticationType==AUTHENTICATION_TYPE.CLIENT_CERT) {
               if (sslKeyManagers==null) {
                   log.error("rws client cert auth requires client cert");
               }
           }
        }
    }