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 ssl option to config so users can silence warnings when connnecting to databases without SSL #101

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ public VoteStorage initializeVoteStorage() throws IOException {
String database = configuration.getString("storage.mysql.database", "superbvote");
String table = configuration.getString("storage.mysql.table", "superbvote");
boolean readOnly = configuration.getBoolean("storage.mysql.read-only");
boolean ssl = configuration.getBoolean("storage.mysql.ssl");

Choose a reason for hiding this comment

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

I think here, the default value should be added as 'true' otherwise users without the config file updated, will not use SSL by default.


HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + database);
config.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + database + "?useSSL=" + ssl);
config.setUsername(username);
config.setPassword(password);
config.setMinimumIdle(2);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ storage:
database: superbvote
table: votes
read-only: false
ssl: true

# General vote configuration.
votes:
Expand Down