/**
 * 
 */
package me.prettyprint.cassandra.connection.factory;

import me.prettyprint.cassandra.connection.client.HClient;
import me.prettyprint.cassandra.connection.client.HThriftClient;
import me.prettyprint.cassandra.connection.security.SSLHelper;
import me.prettyprint.cassandra.service.CassandraHost;

import org.apache.thrift.transport.TSSLTransportFactory.TSSLTransportParameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author patricioe (Patricio Echague - patricio@datastax.com)
 *
 */
public class HThriftClientFactoryImpl implements HClientFactory {
  
  private static final Logger log = LoggerFactory.getLogger(HThriftClientFactoryImpl.class);
  private TSSLTransportParameters params;

  /**
   * {@inheritDoc}
   */
  public HClient createClient(CassandraHost ch) {
    params = SSLHelper.getTSSLTransportParameters();
      
    log.info("SSL enabled for client<->server communications.");
    log.info("Properties:");
    log.info("  ssl.truststore = {}", System.getProperty("ssl.truststore"));
    log.info("  ssl.protocol = {}", System.getProperty("ssl.protocol"));
    log.info("  ssl.store.type = {}", System.getProperty("ssl.store.type"));
    log.info("  ssl.cipher.suites = {}", System.getProperty("ssl.cipher.suites"));
    
    if ( log.isDebugEnabled() ) {
      log.debug("Creation of new client for host: " + ch.getIp());
    }
    
    return params == null ? new HThriftClient(ch) : new HThriftClient(ch, params);
  }

}

@@ -582,19 +582,17 @@
 ctory %7B%0A
-  
 %0A
+
   privat
@@ -857,15 +857,39 @@
 ();%0A
+%0A
     
+if ( params != null ) %7B%0A
   
-%0A
     
@@ -953,24 +953,65 @@
 %22);%0A    
-log.info
+  if ( log.isDebugEnabled() ) %7B%0A        log.debug
 (%22Proper
@@ -1019,32 +1019,37 @@
 ies:%22);%0A    
-log.info
+    log.debug
 (%22  ssl.trus
@@ -1101,32 +1101,37 @@
 ore%22));%0A    
+  
+  
 log.
-info
+debug
 (%22  ssl.prot
@@ -1179,32 +1179,37 @@
 col%22));%0A    
-log.info
+    log.debug
 (%22  ssl.stor
@@ -1265,24 +1265,29 @@
 ));%0A    
-log.info
+    log.debug
 (%22  ssl.
@@ -1357,45 +1357,8 @@
     
-%0A    if ( log.isDebugEnabled() ) %7B%0A  
     
@@ -1422,18 +1422,22 @@
 ));%0A
+      %7D%0A
     %7D%0A
-    
 %0A   

Fix erroneous logging about SSL, move details to debug level