Configure encrypted communication with SQL Server
New versions related applications may require encrypted communication with SQL Server, for example Sitecore Identity Server module version 8.0 and later, and Sitecore Publishing Service version 8.0 and later. This change is due to the adoption of a newer version of Microsoft.Data.SqlClient that enforces increased security, as described in Microsoftâs Breaking changes in EF Core 7.0 article.
To configure encrypted communication with SQL Server:
-
Pull the latest version of the
mssql-developerimage by running command: -
Install the
SitecoreDockerToolsmodule of version 10.4.4 or newer: -
Ensure the folder that stores certificates for Traefik is empty, otherwise the certificates will not be re-created:
-
Run the
compose-init.ps1initialization script to generate certificates (described in the following section). You should see two new certificates were created, which are required to configure trusted encrypted communication between the application and SQL Server:compose\<windows version>\<topology>\mssql\certs\mssql.pfx- contains private key and public certificate which will be used by Sql Server for encryption.compose\<windows version>\<topology>\id\certs\RootCA.crt- public certificate of the certification authority which issued this and other certificates for the Sitecore deployment.
You can provide your own certificates; however, they must meet certain requirements to be used with SQL Server. For more details, refer to the Certificate requirements for SQL Server article.
-
If any Sitecore application requires an encrypted communication with SQL Server, provide the
RootCA.crtfile to it also. Details about the configuration are provided in the application's documentation.
Alternative Configuration: SQL Server-Generated Self-Signed Certificates
To simplify the installation process for a non-production deployment, you can skip configuring an encryption certificate for SQL Server. If the certificate is not explicitly configured, SQL Server automatically generates a self-signed certificate (fallback certificate) at startup and uses it for encryption.
To accommodate this configuration in a Sitecore application, update connection strings of Sitecore databases that the application is referencing in one of the following ways:
1. Disable encryption: Update the connection strings to use parameter:
2. Enable encryption but disable the client's validation of certificate (trust the server's certificate). Update connection strings to use parameters:
For example, for Identity Server 8.0 and above, modify the following line of the identity service in the docker-compose.yml file:
from
to