can't connect to database with sqlsrv
dimas-afprnm opened this issue · 2 comments
[
{
"0": "08001",
"1": -1,
"2": "[Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol]",
"SQLSTATE": "08001",
"code": -1,
"message": "[Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol]"
},
{
"0": "08001",
"1": -1,
"2": "[Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection",
"SQLSTATE": "08001",
"code": -1,
"message": "[Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection"
}
]
This is not a PHP driver issue, but rather compatibility between OpenSSL and SQL Server. Starting with OpenSSL 3.0 TLSv1.0 and TLSv1.1 were deprecated and are not allowed by default, requiring at least TLSv1.2. Many older servers don't have TLSv1.2, thus the connection fails. The ideal solution is to patch or upgrade the server. If that's not possible, one can configure OpenSSL to still allow use of older protocols, but it's best to consult OpenSSL documentation or support for the most up to date instructions for how to do so.