Skip to content

Commit 22e3ad5

Browse files
authored
Move insecureSkipTlsVerify to each Datacenter
Previously in the serverless bundle file "insecureSkipTlsVerify" field was incorrectly put in AuthInfo instead of Datacenter. This change moves "insecureSkipTlsVerify" field to each Datacenter. Similar changes were already done in: scylladb/scylla-ccm#419 and scylladb/python-driver#186.
1 parent b49aa5d commit 22e3ad5

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

driver-core/src/main/java/com/datastax/driver/core/Cluster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ protected Builder withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig co
14081408
new ScyllaCloudSniEndPointFactory(
14091409
proxyAddress, currentDatacenter.getNodeDomain()))
14101410
.withSSL(
1411-
(config.getCurrentAuthInfo().isInsecureSkipTlsVerify()
1411+
(config.getCurrentDatacenter().isInsecureSkipTlsVerify()
14121412
? config.createBundle().getInsecureSSLOptions()
14131413
: config.createBundle().getSSLOptions()))
14141414
.withAuthProvider(

driver-core/src/main/java/com/datastax/driver/core/ScyllaCloudAuthInfo.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class ScyllaCloudAuthInfo {
2626
private final String clientKeyPath;
2727
private final String username;
2828
private final String password;
29-
private final boolean insecureSkipTlsVerify;
3029

3130
@JsonCreator
3231
public ScyllaCloudAuthInfo(
@@ -35,16 +34,13 @@ public ScyllaCloudAuthInfo(
3534
@JsonProperty(value = "clientKeyData") byte[] clientKeyData,
3635
@JsonProperty(value = "clientKeyPath") String clientKeyPath,
3736
@JsonProperty(value = "username") String username,
38-
@JsonProperty(value = "password") String password,
39-
@JsonProperty(value = "insecureSkipTlsVerify", defaultValue = "false")
40-
boolean insecureSkipTlsVerify) {
37+
@JsonProperty(value = "password") String password) {
4138
this.clientCertificateData = clientCertificateData;
4239
this.clientCertificatePath = clientCertificatePath;
4340
this.clientKeyData = clientKeyData;
4441
this.clientKeyPath = clientKeyPath;
4542
this.username = username;
4643
this.password = password;
47-
this.insecureSkipTlsVerify = insecureSkipTlsVerify;
4844
}
4945

5046
public void validate() {
@@ -96,8 +92,4 @@ public String getUsername() {
9692
public String getPassword() {
9793
return password;
9894
}
99-
100-
public boolean isInsecureSkipTlsVerify() {
101-
return insecureSkipTlsVerify;
102-
}
10395
}

driver-core/src/main/java/com/datastax/driver/core/ScyllaCloudDatacenter.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class ScyllaCloudDatacenter {
2020
private final String tlsServerName;
2121
private final String nodeDomain;
2222
private final String proxyURL;
23+
private final boolean insecureSkipTlsVerify;
2324

2425
// Full hostname has limit of 255 chars.
2526
// Host UUID takes 32 chars for hex digits and 4 dashes. Additional 1 is for separator dot before
@@ -33,13 +34,16 @@ public ScyllaCloudDatacenter(
3334
@JsonProperty(value = "server") String server,
3435
@JsonProperty(value = "tlsServerName") String tlsServerName,
3536
@JsonProperty(value = "nodeDomain") String nodeDomain,
36-
@JsonProperty(value = "proxyURL") String proxyURL) {
37+
@JsonProperty(value = "proxyURL") String proxyURL,
38+
@JsonProperty(value = "insecureSkipTlsVerify", defaultValue = "false")
39+
boolean insecureSkipTlsVerify) {
3740
this.certificateAuthorityPath = certificateAuthorityPath;
3841
this.certificateAuthorityData = certificateAuthorityData;
3942
this.server = server;
4043
this.tlsServerName = tlsServerName;
4144
this.nodeDomain = nodeDomain;
4245
this.proxyURL = proxyURL;
46+
this.insecureSkipTlsVerify = insecureSkipTlsVerify;
4347
}
4448

4549
public void validate() {
@@ -85,6 +89,10 @@ public String getProxyURL() {
8589
return proxyURL;
8690
}
8791

92+
public boolean isInsecureSkipTlsVerify() {
93+
return insecureSkipTlsVerify;
94+
}
95+
8896
// Using parts relevant to hostnames as we're dealing with a part of hostname
8997
// RFC-1123 Section 2.1 and RFC-952 1.
9098
private void validateNodeDomain() {

0 commit comments

Comments
 (0)