Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.datastax.driver.core;
Options to provide to enable SSL connections.
public class SSLOptions {
    private static final String SSL_PROTOCOL = "TLS";

The default SSL cipher suites.
    public static final String[] DEFAULT_SSL_CIPHER_SUITES = { "TLS_RSA_WITH_AES_128_CBC_SHA""TLS_RSA_WITH_AES_256_CBC_SHA" };
    final SSLContext context;
    final String[] cipherSuites;

Creates default SSL options.

The resulting options will use the default JSSE options, and you can use the default JSSE System properties to customize it's behavior. This may in particular involve creating a simple keyStore and trustStore.

The cipher suites used by this default instance are the one defined by DEFAULT_SSL_CIPHER_SUITES and match the default cipher suites supported by Cassandra server side.

    public SSLOptions() {

Creates SSL options that uses the provided SSL context and cipher suites.

context the SSLContext to use.
cipherSuites the cipher suites to use.
    public SSLOptions(SSLContext contextString[] cipherSuites) {
        this. = context;
        this. = cipherSuites;
    private static SSLContext makeDefaultContext() throws IllegalStateException {
        try {
            SSLContext ctx = SSLContext.getInstance();
            ctx.init(nullnullnull); // use defaults
            return ctx;
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException("This JVM doesn't support TLS, this shouldn't happen");
        } catch (KeyManagementException e) {
            throw new IllegalStateException("Cannot initialize SSL Context"e);
New to GrepCode? Check out our FAQ X