I have a remote MS-SQL Express 2012 server that is set up for use with SSL. I have all the certs I need. But how can I create a PDO connection to this server using SSL? I have found plenty of articles for PDO with MySQL using SSL, but none for MS-SQL using PDO and SSL.
3
-
Did you ever find an answer to this?Neil Nand– Neil Nand2015-09-08 15:40:07 +00:00Commented Sep 8, 2015 at 15:40
-
Unfortunately not. We set up a VPN and use a non-SSL connection.Sander Marechal– Sander Marechal2015-09-10 08:20:18 +00:00Commented Sep 10, 2015 at 8:20
-
did you try like this : $c = new PDO("sqlsrv:Server=12345abcde.database.windows.net;Database=bddtest", "Utilisateur@12345abcde", "MotDePasse"); ?Mimouni– Mimouni2015-10-15 13:32:23 +00:00Commented Oct 15, 2015 at 13:32
Add a comment
|
1 Answer
(Microsoft OS Only) In order to connect securely, append 'encrypt=true' to the connection string. A valuable blog on the topic.
Also Of Note:
Make sure you are using:
Make sure you aren't using:
The drivers are located here: Microsoft provided drivers.
2 Comments
Sander Marechal
Unfortunately that driver only works on Windows. My web servers all run Linux.
Kyle Wiering
You might be able to use FreeTDS. I am unable to test and verify - but that is the only way I'm aware of in Linux. (it might even use SSL for domain auth connections by default).