Enabling SSL/TLS Encryption for SQL Server in SharePoint Environments
Introduction
In enterprise-grade SharePoint environments, securing the communication between SharePoint servers and SQL Server is paramount. By default, data exchanged between SQL Server and its clients is not encrypted, leaving it vulnerable to interception on the network.
To comply with security standards such as ISO 27001, HIPAA, GDPR, or LGPD, it is highly recommended to implement SSL/TLS encryption for SQL Server connections—particularly when deploying SharePoint farms across subnets, virtual networks, or hybrid topologies.
This article explains, in detail, how to configure SQL Server to enforce encryption using SSL/TLS, and how to validate that encryption is active in SharePoint.
Why Use SSL/TLS for SQL Server?
- Data Confidentiality: Prevents packet sniffing and man-in-the-middle (MITM) attacks.
- Compliance: Required by industry standards and internal audit policies.
- Authentication: Validates the SQL Server identity using digital certificates.
- Secure Administration: Encrypts communication during management via SSMS or PowerShell.
Prerequisites
Before configuring encryption:
- Obtain a valid X.509 certificate:
- Issued by an internal or external Certificate Authority (CA).
- Must have the FQDN of the SQL Server in the
SubjectorSubject Alternative Name(SAN). - Key usage should include Server Authentication (
EKU=1.3.6.1.5.5.7.3.1).
- Install the certificate:
- Place it in the Local Computer > Personal store on the SQL Server machine.
Configuring SSL/TLS Encryption for SQL Server
Step 1: Bind the Certificate
- Open SQL Server Configuration Manager.
- Go to SQL Server Network Configuration > Protocols for [Instance Name].
- Right-click Properties > Go to the Certificate tab.
- Select the installed certificate from the dropdown.
- On the Flags tab:
- Set Force Encryption to Yes.
- Restart the SQL Server service.
Note: Ensure the SQL Server service account has read access to the private key of the certificate.
Step 2: Configure Client Encryption in SharePoint
SharePoint communicates with SQL Server using .NET clients. If you enforce encryption, clients must also be configured to trust the SQL Server certificate.
Edit the SQL Native Client or .NET connection string to include:
Encrypt=True;TrustServerCertificate=False;
For SharePoint:
- Open Central Administration > Manage Servers in this Farm.
- Ensure all servers can validate the SQL Server’s certificate chain.
- If needed, deploy the CA certificate to Trusted Root Certification Authorities on SharePoint servers.
Alternatively, use TrustServerCertificate=True if the certificate is self-signed—but this is not recommended for production.
Verifying Encrypted SQL Connections
Option 1: SQL Server DMV Query
Run the following query on SQL Server:
SELECT session_id, encrypt_option, net_transport
FROM sys.dm_exec_connections
WHERE session_id = @@SPID;
encrypt_optionshould returnTRUE.
Option 2: Wireshark Packet Capture
Capture network traffic on port 1433:
- Look for TLS handshake.
- Plaintext SQL queries should not be visible.
PowerShell Script to Deploy Certificate and Verify
Here is a PowerShell snippet to check certificate presence and test binding:
$cert = Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {
$_.Subject -like "*your-sql-fqdn.domain.com*" -and
$_.EnhancedKeyUsageList.FriendlyName -contains "Server Authentication"
}
if ($cert) {
Write-Output "Certificate found and valid for SSL."
} else {
Write-Warning "Valid certificate not found."
}
Troubleshooting Tips
| Issue | Cause | Solution |
|---|---|---|
| Connection fails after enabling SSL | Invalid or untrusted certificate | Ensure the certificate is valid and trusted on the client |
| SQL Server doesn’t use the certificate | Certificate not selected or wrong SAN | Rebind and ensure FQDN matches certificate subject |
| SharePoint cannot connect after change | Certificate trust issue or missing Encrypt settings | Use TrustServerCertificate=True for testing (not production) |
| SSMS shows “encryption not enabled” | Encryption not forced or misconfigured | Set Force Encryption = Yes and restart SQL Server |
Summary Table: SSL/TLS Configuration Steps
| Step | Action | Tool/Location |
|---|---|---|
| 1 | Generate or import certificate | Certificate Authority / MMC |
| 2 | Install cert in LocalMachine\My store | certlm.msc |
| 3 | Bind cert to SQL instance | SQL Server Configuration Manager |
| 4 | Enable Force Encryption | SQL Server Configuration Manager |
| 5 | Restart SQL Server | Services.msc or SQL Server Configuration Tool |
| 6 | Configure SharePoint servers to trust cert | MMC + Group Policy (if needed) |
| 7 | Validate using DMV or Wireshark | SQL Server / Network Tools |
