Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the ability to connect to Cassandra using SSL connections. #1294

Merged
merged 4 commits into from
Apr 19, 2019
Merged

Adding the ability to connect to Cassandra using SSL connections. #1294

merged 4 commits into from
Apr 19, 2019

Conversation

voellm
Copy link
Contributor

@voellm voellm commented Apr 19, 2019

Small change to add a new flag called useSSL. It flag adds the ability to use secure connections. The default is "false" which is how the current driver connects. Personally I think the default should be secure connections but I dont want to break compatibility.

if ((username != null) && !username.isEmpty()) {
cluster = Cluster.builder().withCredentials(username, password)
.withPort(Integer.valueOf(port)).addContactPoints(hosts).build();
if (useSSL) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these lines of code be merged into just a couple of lines like below?

clusterBuilder = Cluster.builder().with.....addContactPoints(hosts)
if (useSSL) ClusterBuilder = clusterBulider.withSSL()
Cluster = clusterBuilder.build()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure let me try and optimize it.

Copy link
Collaborator

@stfeng2 stfeng2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have one minor comment here. PTAL.

@stfeng2 stfeng2 merged commit acc4300 into brianfrankcooper:master Apr 19, 2019
@busbey busbey mentioned this pull request Jun 4, 2019
@busbey busbey mentioned this pull request Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants