Permalink
Browse files

formatting fix on sslhelper

  • Loading branch information...
1 parent 0f24241 commit 008043187de8e959b2037240c2d4b50c36bc74e1 @zznate zznate committed Nov 7, 2012
Showing with 35 additions and 36 deletions.
  1. +35 −36 core/src/main/java/me/prettyprint/cassandra/connection/security/SSLHelper.java
@@ -3,40 +3,39 @@
import org.apache.thrift.transport.TSSLTransportFactory;
import org.apache.thrift.transport.TSSLTransportFactory.TSSLTransportParameters;
-public class SSLHelper
-{
- public static final String SSL_PROTOCOL = "SSL";
- public static final String SSL_STORE_TYPE = "JKS";
- public static final String TRUST_MANAGER_TYPE = "X509";
-
- /**
- * build TSSLTranportParameters by getting trust store path, trust store password,
- * ssl protocol (default SSL) , store type (default JKS), cipher suites
- *
- */
- public static TSSLTransportParameters getTSSLTransportParameters() {
- String SSLTrustStore = System.getProperty("ssl.truststore");
- if (SSLTrustStore == null)
- return null;
-
- String SSLTrustStorePassword = System.getProperty("ssl.truststore.password");
- String SSLProtocol = System.getProperty("ssl.protocol");
- String SSLStoreType = System.getProperty("ssl.store.type");
- String SSLCipherSuites = System.getProperty("ssl.cipher.suites");
-
- if (SSLProtocol == null)
- SSLProtocol = SSL_PROTOCOL;
-
- if (SSLStoreType == null)
- SSLStoreType = SSL_STORE_TYPE;
-
- String [] cipherSuites = null;
- if (SSLCipherSuites != null)
- cipherSuites = SSLCipherSuites.split(",");
-
- TSSLTransportParameters params = new TSSLTransportFactory.TSSLTransportParameters(SSLProtocol, cipherSuites);
- params.setTrustStore(SSLTrustStore, SSLTrustStorePassword, TRUST_MANAGER_TYPE, SSLStoreType);
- return params;
- }
-
+public class SSLHelper {
+ public static final String SSL_PROTOCOL = "SSL";
+ public static final String SSL_STORE_TYPE = "JKS";
+ public static final String TRUST_MANAGER_TYPE = "X509";
+
+ /**
+ * build TSSLTranportParameters by getting trust store path, trust store password,
+ * ssl protocol (default SSL) , store type (default JKS), cipher suites
+ *
+ */
+ public static TSSLTransportParameters getTSSLTransportParameters() {
+ String SSLTrustStore = System.getProperty("ssl.truststore");
+ if (SSLTrustStore == null)
+ return null;
+
+ String SSLTrustStorePassword = System.getProperty("ssl.truststore.password");
+ String SSLProtocol = System.getProperty("ssl.protocol");
+ String SSLStoreType = System.getProperty("ssl.store.type");
+ String SSLCipherSuites = System.getProperty("ssl.cipher.suites");
+
+ if (SSLProtocol == null)
+ SSLProtocol = SSL_PROTOCOL;
+
+ if (SSLStoreType == null)
+ SSLStoreType = SSL_STORE_TYPE;
+
+ String [] cipherSuites = null;
+ if (SSLCipherSuites != null)
+ cipherSuites = SSLCipherSuites.split(",");
+
+ TSSLTransportParameters params = new TSSLTransportFactory.TSSLTransportParameters(SSLProtocol, cipherSuites);
+ params.setTrustStore(SSLTrustStore, SSLTrustStorePassword, TRUST_MANAGER_TYPE, SSLStoreType);
+ return params;
+ }
+
}

0 comments on commit 0080431

Please sign in to comment.