Skip to content

Commit

Permalink
mcMMO now supports SSL and tries to use it by default for MySQL (turn…
Browse files Browse the repository at this point in the history
… this off in config.yml MySQL.Server.SSL)

this fixes a lot of console spam from default mysql installs
  • Loading branch information
nossr50 committed Jan 13, 2019
1 parent 1f2e6cd commit 4cfb7a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changelog.txt
Expand Up @@ -15,9 +15,11 @@ Version 2.1.0
+ Added links to mcMMO related websites to various commands
+ Certain elements of mcMMO's UI have been restyled
+ Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out
+ (MySQL) Added support for SSL for MySQL/MariaDB (Off by default)
+ (Skills) Tool alerts now are sent to the Action Bar
+ (Skills) Super Ability activation alerts are now sent to the Action Bar
+ (Skills) Certain Skill messages are now sent to the Action Bar
+ (Config) Added option to use SSL for MySQL in config.yml
+ (Config) Added option to disable the new URL links to config.yml
+ (Config) New config file added coreskills.yml
+ (Config) Added rank settings for the new Woodcutting skill
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/gmail/nossr50/config/Config.java
Expand Up @@ -346,6 +346,7 @@ public MobHealthbarType getMobHealthbarDefault() {
public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); }
public int getMySQLMaxConnections(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); }
public int getMySQLMaxPoolSize(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); }
public boolean getMySQLSSL() { return config.getBoolean("MySQL.Server.SSL", true); }

private String getStringIncludingInts(String key) {
String str = config.getString(key);
Expand Down
Expand Up @@ -36,6 +36,13 @@ protected SQLDatabaseManager() {
String connectionString = "jdbc:mysql://" + Config.getInstance().getMySQLServerName()
+ ":" + Config.getInstance().getMySQLServerPort() + "/" + Config.getInstance().getMySQLDatabaseName();

if(Config.getInstance().getMySQLSSL())
connectionString = "jdbc:mysql://" + Config.getInstance().getMySQLServerName()
+ ":" + Config.getInstance().getMySQLServerPort() + "/" + Config.getInstance().getMySQLDatabaseName() +
"?verifyServerCertificate=false"+
"&useSSL=true"+
"&requireSSL=true";

try {
// Force driver to load if not yet loaded
Class.forName("com.mysql.jdbc.Driver");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Expand Up @@ -166,7 +166,7 @@ MySQL:
Load: 20
Save: 20
Server:
SSL: false
SSL: true
Port: 3306
Address: localhost

Expand Down

0 comments on commit 4cfb7a5

Please sign in to comment.