sql server - Connecting to MSSQL from PHP securely with encryption? -



sql server - Connecting to MSSQL from PHP securely with encryption? -

i need connect mssql database php. however, server on remote site connected, require connection encrypted.

is possible utilize encrypt connection mssql server using mssql extension php or alternatively pdo?

there 3 things of import when implementing secure (encrypted) connection mssql:

the options encrypt , trustservercertificate used together. by default sql server installs self-signed certificate utilize encrypt connections - self signed certificate open attacks. should replaced 1 certificate authorization (ca). after replacing certificate, set encrypt = true , trustservercertificate = false (trustservercertificate = true work, connection vulnerable attacks)

code-example article *1:

$servername = "servername"; $connectioninfo = array( "database"=>"dbname", "uid"=>"username", "pwd"=>"password", "encrypt"=>true, "trustservercertificate"=>false); $conn = sqlsrv_connect( $servername, $connectioninfo);

if utilize pdo create object , pass relevant params. more detailed explanation please see next article:

*1 - http://blogs.msdn.com/b/brian_swan/archive/2011/03/08/sql-server-driver-for-php-connection-options-encrypt.aspx

php sql-server pdo

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -