#1063 Add useSSL option
This commit is contained in:
@@ -31,6 +31,7 @@ import java.util.Set;
|
||||
|
||||
public class MySQL implements DataSource {
|
||||
|
||||
private boolean useSSL;
|
||||
private String host;
|
||||
private String port;
|
||||
private String username;
|
||||
@@ -100,6 +101,7 @@ public class MySQL implements DataSource {
|
||||
if (poolSize == -1) {
|
||||
poolSize = Utils.getCoreCount();
|
||||
}
|
||||
this.useSSL = settings.getProperty(DatabaseSettings.MYSQL_USE_SSL);
|
||||
}
|
||||
|
||||
private void setConnectionArguments() {
|
||||
@@ -116,6 +118,9 @@ public class MySQL implements DataSource {
|
||||
ds.setUsername(this.username);
|
||||
ds.setPassword(this.password);
|
||||
|
||||
// Request mysql over SSL
|
||||
ds.addDataSourceProperty("useSSL", useSSL);
|
||||
|
||||
// Encoding
|
||||
ds.addDataSourceProperty("characterEncoding", "utf8");
|
||||
ds.addDataSourceProperty("encoding","UTF-8");
|
||||
|
||||
@@ -58,6 +58,10 @@ public class DatabaseSettings implements SettingsHolder {
|
||||
public static final Property<String> MYSQL_COL_PASSWORD =
|
||||
newProperty("DataSource.mySQLColumnPassword", "password");
|
||||
|
||||
@Comment("Request mysql over SSL")
|
||||
public static final Property<Boolean> MYSQL_USE_SSL =
|
||||
newProperty("DataSource.mySQLUseSSL", true);
|
||||
|
||||
@Comment("Column for storing players passwords salts")
|
||||
public static final Property<String> MYSQL_COL_SALT =
|
||||
newProperty("ExternalBoardOptions.mySQLColumnSalt", "");
|
||||
|
||||
Reference in New Issue
Block a user