mirror of
https://github.com/databasus/databasus.git
synced 2026-04-06 00:32:03 +02:00
FIX (mariadb\mysql): Skip SSL if https mode is set to false
This commit is contained in:
@@ -130,6 +130,8 @@ func (uc *CreateMariadbBackupUsecase) buildMariadbDumpArgs(
|
||||
if mdb.IsHttps {
|
||||
args = append(args, "--ssl")
|
||||
args = append(args, "--skip-ssl-verify-server-cert")
|
||||
} else {
|
||||
args = append(args, "--skip-ssl")
|
||||
}
|
||||
|
||||
if mdb.Database != nil && *mdb.Database != "" {
|
||||
|
||||
@@ -127,6 +127,8 @@ func (uc *CreateMysqlBackupUsecase) buildMysqldumpArgs(my *mysqltypes.MysqlDatab
|
||||
|
||||
if my.IsHttps {
|
||||
args = append(args, "--ssl-mode=REQUIRED")
|
||||
} else {
|
||||
args = append(args, "--ssl-mode=DISABLED")
|
||||
}
|
||||
|
||||
if my.Database != nil && *my.Database != "" {
|
||||
@@ -327,6 +329,8 @@ port=%d
|
||||
|
||||
if myConfig.IsHttps {
|
||||
content += "ssl-mode=REQUIRED\n"
|
||||
} else {
|
||||
content += "ssl-mode=DISABLED\n"
|
||||
}
|
||||
|
||||
err = os.WriteFile(myCnfFile, []byte(content), 0o600)
|
||||
|
||||
@@ -77,6 +77,8 @@ func (uc *RestoreMariadbBackupUsecase) Execute(
|
||||
if mdb.IsHttps {
|
||||
args = append(args, "--ssl")
|
||||
args = append(args, "--skip-ssl-verify-server-cert")
|
||||
} else {
|
||||
args = append(args, "--skip-ssl")
|
||||
}
|
||||
|
||||
if mdb.Database != nil && *mdb.Database != "" {
|
||||
|
||||
@@ -76,6 +76,8 @@ func (uc *RestoreMysqlBackupUsecase) Execute(
|
||||
|
||||
if my.IsHttps {
|
||||
args = append(args, "--ssl-mode=REQUIRED")
|
||||
} else {
|
||||
args = append(args, "--ssl-mode=DISABLED")
|
||||
}
|
||||
|
||||
if my.Database != nil && *my.Database != "" {
|
||||
@@ -305,6 +307,8 @@ port=%d
|
||||
|
||||
if myConfig.IsHttps {
|
||||
content += "ssl-mode=REQUIRED\n"
|
||||
} else {
|
||||
content += "ssl-mode=DISABLED\n"
|
||||
}
|
||||
|
||||
err = os.WriteFile(myCnfFile, []byte(content), 0o600)
|
||||
|
||||
Reference in New Issue
Block a user