Showing posts with label Tabular Data Stream. Show all posts
Showing posts with label Tabular Data Stream. Show all posts

Wednesday, January 2, 2013

Encrypt Connections to SQL Server

By default , the connections to SQL Server are not encrypted.

C:\>sqlcmd -W
1>  Select  protocol_type , encrypt_option  from sys.dm_exec_connections;
2> go


protocol_type encrypt_option
------------- --------------
TSQL FALSE
TSQL FALSE


We  can use SSL to encrypt the connections using SQL Server  Configuration Manager . 
Here are the steps.

a)  Expand "SQL Server Network Configuration " in the left panel
b) Right Click on  the "Protocols for XXXX" ( where XXXX is the ServiceName ) and select Properties.
c) Select "Yes" in the "Force Encryption " in the "Flags" tab.
d) Select the certificate in the "Certificate" tab. ( Note : If you don't specify  the certificate , SQL Server uses the self signed certificate) .
e) Click OK and restart the service(s) 


To verify the changes , run the following SQL .


C:\>sqlcmd -W
1>  Select  protocol_type , encrypt_option  from sys.dm_exec_connections;
2> go
protocol_type encrypt_option
------------- --------------
TSQL TRUE
TSQL TRUE
TSQL TRUE
TSQL TRUE


Comments Welcome.