How to connect to SQL using SSL?

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.

  • Answer:

    What have you tried already ? http://php.net/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?

Aditya at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

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

P. Sohm

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.