5

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? Commented Sep 8, 2015 at 15:40
  • Unfortunately not. We set up a VPN and use a non-SSL connection. Commented 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"); ? Commented Oct 15, 2015 at 13:32

1 Answer 1

0

(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.

Sign up to request clarification or add additional context in comments.

2 Comments

Unfortunately that driver only works on Windows. My web servers all run Linux.
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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.