Aditya
Aditya

Reputation: 1755

Connect to SQL Server Server with SSL from PHP

How do I connect to a SQL Server with SSL from PHP?

Edit I should be more elaborate on this. We have a php-mysql application. We need to save data on a SQL Server also. Initially we were using mssql_connect('server', 'db_user', 'db_pwd') to connect to the remote SQL server. but now we need to send it over ssl.

We would like to use the existing ssl cert already on server (currently used by site on IIS as ssl cert) to make it so we can connect to SQL Server with secure connection.

Upvotes: 0

Views: 3625

Answers (2)

oursgris
oursgris

Reputation: 2882

mssql_connect can use secured connection if php is configured ...

go into the php.ini and verify the mssql.secure_connection parameter :

[MSSQL]
mssql.secure_connection = On

Upvotes: 2

edorian
edorian

Reputation: 38961

What have you tried already ?

mssql_connect() should work out for you.

Since you provided no error I'm guessing: "Warning: mssql_connect(): Unable to connect to: OURSERVER.local in ...." ?

Have you set the mssql.secure_connection ini option to true?

Upvotes: 3

Related Questions