How To Configure SSL Encryption in SQL Server
How To Configure SSL Encryption in SQL Server
Problem
I read in a PCI security tip that I should configure Secure Sockets Layer (SSL) encryption on our SQL Servers, but this
requires a trusted certificate. Could you please help me on how to complete this task?
Solution
The Secure Sockets Layer (SSL) can be used to encrypt data transferred on your network between your SQL Server instance
and a client application. SSL uses certificates to validate the server and the client should verify the certificate using the chain
of trust where the trust anchor is the root certificate authority. This requires that the client computer should trust the root
authority of the certificate used by your SQL Server. SQL Server can do this using 128-bit encryption.
It must be valid thus the current system date and time should be between the Valid From and Valid To properties of the
certificate.
The Common Name (CN) in the Subject property of the certificate must be the same as the fully qualified domain name
(FQDN) of the server computer.
It must be issued for server authentication so the Enhanced Key Usage property of the certificate should include 'Server
Authentication (1.3.6.1.5.5.7.3.1)' (see below).
https://www.mssqltips.com/sqlservertip/3299/how-to-configure-ssl-encryption-in-sql-server/ 1/5
5/10/2019 How to configure SSL encryption in SQL Server
It is possible to use self-signed certificates, but I recommend only doing this for test purposes because this significantly lowers
the level of security.
4. You are prompted to open the snap-in for your user account, the service account, or the computer account. Select the
Computer Account.
5. Select Local computer, and then click Finish.
6. Click OK in the Add/Remove Snap-in dialog box.
7. Click to select the Personal folder in the left-hand pane.
8. Right-click in the right-hand pane, point to All Tasks, and then click Request New Certificate...
9. Click Next in the Certificate Request Wizard dialog box. Select certificate type 'Computer'.
10. You can enter a friendly name in text box if you want or leave it blank, then complete the wizard.
11. Now you should see the certificate in the folder with the fully qualified computer domain name.
https://www.mssqltips.com/sqlservertip/3299/how-to-configure-ssl-encryption-in-sql-server/ 2/5
5/10/2019 How to configure SSL encryption in SQL Server
1. Expand SQL Server Network Configuration and right-click on Protocols for <YourMSSQLServer>, then click
Properties.
2. On the Certificate tab, select the certificate you would like to use.
3. On the Flags tab, select Yes in the ForceEncryption box, then click OK.
4. Restart the SQL Server service.
You can also encrypt the connection from SQL Server Management Studio:
https://www.mssqltips.com/sqlservertip/3299/how-to-configure-ssl-encryption-in-sql-server/ 3/5
5/10/2019 How to configure SSL encryption in SQL Server
The following steps should be performed on all of the nodes in the cluster:
1. Navigate to the certificate in the MMC Certificates Snap-in and double click to open the certificate.
2. Copy the hex value from the Thumbprint property on the Details tab to Notepad and remove the spaces.
3. Start Regedit and copy the hex value to this key: HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\
<YourSQLServerInstance>\MSSQLServer\SuperSocketNetLib\Certificate
4. You will have to reboot your node, so it is recommended to failover to another node first.
Next Steps
Obtain a certificate and try to configure it in your test environment.
You can find more articles in the Security category.
Read more tips by the author here
https://www.mssqltips.com/sqlservertip/3299/how-to-configure-ssl-encryption-in-sql-server/ 4/5
5/10/2019 How to configure SSL encryption in SQL Server
Last Updated: 2014-08-12
Related Resources
More SQL Server DBA Tips...
https://www.mssqltips.com/sqlservertip/3299/how-to-configure-ssl-encryption-in-sql-server/ 5/5