Add 'encrypt' setting to MSSQL data source.

Fixes #13629
This commit is contained in:
Ramiro Morales
2018-10-15 14:41:46 -03:00
parent 938541be2e
commit 37f16ca80a
3 changed files with 20 additions and 6 deletions

View File

@@ -52,12 +52,14 @@ func generateConnectionString(datasource *models.DataSource) string {
}
server, port := hostParts[0], hostParts[1]
return fmt.Sprintf("server=%s;port=%s;database=%s;user id=%s;password=%s;",
encrypt := datasource.JsonData.Get("sslmode").MustString("false")
return fmt.Sprintf("server=%s;port=%s;database=%s;user id=%s;password=%s;encrypt=%s;",
server,
port,
datasource.Database,
datasource.User,
password,
encrypt,
)
}