@@ -94,14 +94,26 @@ public class CcmBridge implements AutoCloseable {
94
94
public static final String DEFAULT_SERVER_TRUSTSTORE_PASSWORD = "scylla1sfun" ;
95
95
public static final String DEFAULT_SERVER_TRUSTSTORE_PATH = "/server.truststore" ;
96
96
97
+ public static final String DEFAULT_SERVER_TRUSTSTORE_PEM_PATH = "/server.truststore.pem" ;
98
+
97
99
private static final File DEFAULT_SERVER_TRUSTSTORE_FILE =
98
100
createTempStore (DEFAULT_SERVER_TRUSTSTORE_PATH );
101
+ private static final File DEFAULT_SERVER_TRUSTSTORE_PEM_FILE =
102
+ createTempStore (DEFAULT_SERVER_TRUSTSTORE_PEM_PATH );
99
103
100
104
public static final String DEFAULT_SERVER_KEYSTORE_PASSWORD = "scylla1sfun" ;
101
105
public static final String DEFAULT_SERVER_KEYSTORE_PATH = "/server.keystore" ;
102
106
107
+ // Contain the same keypair as the server keystore, but in format usable by Scylla
108
+ public static final String DEFAULT_SERVER_PRIVATE_KEY_PATH = "/server.key" ;
109
+ public static final String DEFAULT_SERVER_CERT_CHAIN_PATH = "/server.crt" ;
110
+
103
111
private static final File DEFAULT_SERVER_KEYSTORE_FILE =
104
112
createTempStore (DEFAULT_SERVER_KEYSTORE_PATH );
113
+ private static final File DEFAULT_SERVER_PRIVATE_KEY_FILE =
114
+ createTempStore (DEFAULT_SERVER_PRIVATE_KEY_PATH );
115
+ private static final File DEFAULT_SERVER_CERT_CHAIN_FILE =
116
+ createTempStore (DEFAULT_SERVER_CERT_CHAIN_PATH );
105
117
106
118
// A separate keystore where the certificate has a CN of localhost, used for hostname
107
119
// validation testing.
@@ -550,15 +562,25 @@ public Builder withCreateOption(String option) {
550
562
/** Enables SSL encryption. */
551
563
public Builder withSsl () {
552
564
cassandraConfiguration .put ("client_encryption_options.enabled" , "true" );
553
- cassandraConfiguration .put ("client_encryption_options.optional" , "false" );
554
- cassandraConfiguration .put (
555
- "client_encryption_options.keystore" , DEFAULT_SERVER_KEYSTORE_FILE .getAbsolutePath ());
556
- cassandraConfiguration .put (
557
- "client_encryption_options.keystore_password" , DEFAULT_SERVER_KEYSTORE_PASSWORD );
565
+ if (SCYLLA_ENABLEMENT ) {
566
+ cassandraConfiguration .put (
567
+ "client_encryption_options.certificate" ,
568
+ DEFAULT_SERVER_CERT_CHAIN_FILE .getAbsolutePath ());
569
+ cassandraConfiguration .put (
570
+ "client_encryption_options.keyfile" , DEFAULT_SERVER_PRIVATE_KEY_FILE .getAbsolutePath ());
571
+ } else {
572
+ cassandraConfiguration .put ("client_encryption_options.optional" , "false" );
573
+ cassandraConfiguration .put (
574
+ "client_encryption_options.keystore" , DEFAULT_SERVER_KEYSTORE_FILE .getAbsolutePath ());
575
+ cassandraConfiguration .put (
576
+ "client_encryption_options.keystore_password" , DEFAULT_SERVER_KEYSTORE_PASSWORD );
577
+ }
558
578
return this ;
559
579
}
560
580
561
581
public Builder withSslLocalhostCn () {
582
+ // FIXME: Add Scylla support.
583
+ // @IntegrationTestDisabledCassandra3Failure @IntegrationTestDisabledSSL
562
584
cassandraConfiguration .put ("client_encryption_options.enabled" , "true" );
563
585
cassandraConfiguration .put ("client_encryption_options.optional" , "false" );
564
586
cassandraConfiguration .put (
@@ -573,10 +595,17 @@ public Builder withSslLocalhostCn() {
573
595
public Builder withSslAuth () {
574
596
withSsl ();
575
597
cassandraConfiguration .put ("client_encryption_options.require_client_auth" , "true" );
576
- cassandraConfiguration .put (
577
- "client_encryption_options.truststore" , DEFAULT_SERVER_TRUSTSTORE_FILE .getAbsolutePath ());
578
- cassandraConfiguration .put (
579
- "client_encryption_options.truststore_password" , DEFAULT_SERVER_TRUSTSTORE_PASSWORD );
598
+ if (SCYLLA_ENABLEMENT ) {
599
+ cassandraConfiguration .put (
600
+ "client_encryption_options.truststore" ,
601
+ DEFAULT_SERVER_TRUSTSTORE_PEM_FILE .getAbsolutePath ());
602
+ } else {
603
+ cassandraConfiguration .put (
604
+ "client_encryption_options.truststore" ,
605
+ DEFAULT_SERVER_TRUSTSTORE_FILE .getAbsolutePath ());
606
+ cassandraConfiguration .put (
607
+ "client_encryption_options.truststore_password" , DEFAULT_SERVER_TRUSTSTORE_PASSWORD );
608
+ }
580
609
return this ;
581
610
}
582
611
0 commit comments