Connection to the MSSQL server through PHP PDO via SSL

I have a working connection to the MSSQL server through PHP PDO.

$mssql = new PDO('dblib:host=1.2.3.4;dbname=databasename', 'username', 'password'); 

I need this connection to be secure by sending all transactions over SSL. I do not see any links to secure connections in the PHP manual for the DBLIB driver.

Can someone give some idea on how I can enable this connection over SSL? (I have the option to export and import certificates on both servers, if necessary.)

EDIT: I'm on PHP 5.5.9.

+7
php mysql sql-server pdo ssl
source share
1 answer

Not sure about your server setup, but the β€œofficial” way to do this is with Microsoft drivers. Unfortunately, they only work with SSL for Windows PHP servers. Below are the connection options .

If you are working on Linux, there is one parameter that performs SSL, but it is not officially supported by MS.

0
source share

All Articles