Implement allowPublicKeyRetrieval option in mysql datasource
This commit is contained in:
@@ -39,6 +39,7 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
|
||||
private boolean useSsl;
|
||||
private boolean serverCertificateVerification;
|
||||
private boolean allowPublicKeyRetrieval;
|
||||
private String host;
|
||||
private String port;
|
||||
private String username;
|
||||
@@ -118,6 +119,7 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
this.maxLifetime = settings.getProperty(DatabaseSettings.MYSQL_CONNECTION_MAX_LIFETIME);
|
||||
this.useSsl = settings.getProperty(DatabaseSettings.MYSQL_USE_SSL);
|
||||
this.serverCertificateVerification = settings.getProperty(DatabaseSettings.MYSQL_CHECK_SERVER_CERTIFICATE);
|
||||
this.allowPublicKeyRetrieval = settings.getProperty(DatabaseSettings.MYSQL_ALLOW_PUBLIC_KEY_RETRIEVAL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,6 +149,9 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
// Disabling server certificate verification on need
|
||||
if (!serverCertificateVerification) {
|
||||
ds.addDataSourceProperty("verifyServerCertificate", String.valueOf(false));
|
||||
} // Disabling server certificate verification on need
|
||||
if (allowPublicKeyRetrieval) {
|
||||
ds.addDataSourceProperty("allowPublicKeyRetrieval", String.valueOf(true));
|
||||
}
|
||||
|
||||
// Encoding
|
||||
|
||||
Reference in New Issue
Block a user