- Posts: 10
- Thank you received: 1
Encrypt MS SQL connection using SSL
4 months 4 weeks ago #174062
by efingdmi
Encrypt MS SQL connection using SSL was created by efingdmi
Hi all,
does anybody know how to encrypt the connection to my SQL Server 2016 with SSL?
I know this is more a Yii framework question but I almost spent a whole day and I still have no idea.
Thanks
does anybody know how to encrypt the connection to my SQL Server 2016 with SSL?
I know this is more a Yii framework question but I almost spent a whole day and I still have no idea.
Thanks

Please Log in or Create an account to join the conversation.
4 months 4 weeks ago - 4 months 4 weeks ago #174087
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Encrypt MS SQL connection using SSL
I'm using LimeSurvey with MS SQLServer, so I cannot test my recommendation 
SQL Server are using certain flags, which enforce encryption and cert checking.
The complete options:
docs.microsoft.com/en-us/sql/connect/php...view=sql-server-2016
A simple PHP code would look like this:
secure.php.net/manual/en/ref.pdo-sqlsrv.connection.php
docs.microsoft.com/en-us/sql/connect/php...view=sql-server-2016

SQL Server are using certain flags, which enforce encryption and cert checking.
Encrypt-Specifies whether the communication with SQL Server is encrypted (1 or TRUE) or unencrypted (0 or FALSE).
TrustServerCertificate - Specifies whether the client should trust (1 or TRUE) or reject (0 or FALSE) a self-signed server certificate.
The complete options:
docs.microsoft.com/en-us/sql/connect/php...view=sql-server-2016
A simple PHP code would look like this:
$connectionInfo = array( "Database"=>"DbName",
"UID"=>"UserName",
"PWD"=>"Password",
"Encrypt"=>true,
"TrustServerCertificate"=>false);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
secure.php.net/manual/en/ref.pdo-sqlsrv.connection.php
docs.microsoft.com/en-us/sql/connect/php...view=sql-server-2016
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 4 months 4 weeks ago by jelo.
The following user(s) said Thank You: DenisChenu, efingdmi
Please Log in or Create an account to join the conversation.
4 months 4 weeks ago #174091
by efingdmi
Replied by efingdmi on topic Encrypt MS SQL connection using SSL
Hi Jelo,
thanks for the answer. You are totaly right. I had the solution right in front of my eyes but I insert the Encrypt => true, on the wrong place... Wasted a couple of hours -.-
Thanks
thanks for the answer. You are totaly right. I had the solution right in front of my eyes but I insert the Encrypt => true, on the wrong place... Wasted a couple of hours -.-
Thanks

Please Log in or Create an account to join the conversation.