From 0eaf9d10e9f733703be612b4f1e10174a4f9db65 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 5 Oct 2023 20:46:20 +0300 Subject: [PATCH] Fix SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate --- adminer/drivers/mssql.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php index c8ed37c99..be4ac52bc 100644 --- a/adminer/drivers/mssql.inc.php +++ b/adminer/drivers/mssql.inc.php @@ -29,6 +29,14 @@ function connect($server, $username, $password) { if ($db != "") { $connection_info["Database"] = $db; } + $ssl = $adminer->connectSsl(); + $options = ['TrustServerCertificate', 'Encrypt']; + foreach ($options as $k) { + $connection_info[$k] = false; + if (isset($ssl[$k])) { + $connection_info[$k] = (bool)$ssl[$k]; + } + } $this->_link = @sqlsrv_connect(preg_replace('~:~', ',', $server), $connection_info); if ($this->_link) { $info = sqlsrv_server_info($this->_link);