1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-20 05:11:25 +02:00

MSSQL: Allow to set Encrypt and TrustServerCertificate with AdminerLoginSsl plugin (issue #5)

https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax#use-trustservercertificate
This commit is contained in:
Peter Knut
2024-11-10 21:57:12 +01:00
committed by Jakub Vrana
parent a685d414ad
commit 5eb3446908
3 changed files with 17 additions and 7 deletions

View File

@@ -24,8 +24,15 @@ if (isset($_GET["mssql"])) {
function connect($server, $username, $password) {
global $adminer;
$db = $adminer->database();
$connection_info = array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8");
$ssl = $adminer->connectSsl();
if (isset($ssl["Encrypt"])) {
$connection_info["Encrypt"] = $ssl["Encrypt"];
}
if (isset($ssl["TrustServerCertificate"])) {
$connection_info["TrustServerCertificate"] = $ssl["TrustServerCertificate"];
}
$db = $adminer->database();
if ($db != "") {
$connection_info["Database"] = $db;
}