Skip to content

Commit a7c05b3

Browse files
authored
Merge pull request #36734 from VanMSFT/vanmsft/uuf-security-batch5-feb27
Resolve 4 UUF items: TDE restore, certificate config, ML Services versions
1 parent 016f291 commit a7c05b3

3 files changed

Lines changed: 174 additions & 44 deletions

File tree

docs/database-engine/configure-windows/certificate-requirements.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ description: This article describes the requirements for SQL Server encryption a
44
author: VanMSFT
55
ms.author: vanto
66
ms.reviewer: randolphwest
7-
ms.date: 08/26/2025
7+
ms.date: 02/27/2026
8+
ai-usage: ai-assisted
89
ms.service: sql
910
ms.subservice: configuration
1011
ms.topic: concept-article
@@ -18,7 +19,7 @@ This article describes certificate requirements for [!INCLUDE [ssnoversion-md](.
1819

1920
For using Transport Layer Security (TLS) for [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] encryption, you need to provision a certificate (one of the three digital types) that meets the following conditions:
2021

21-
- The certificate must be in either the local computer certificate store or the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] service account certificate store. We recommend local computer certificate store as it avoids reconfiguring certificates with [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] startup account changes.
22+
- The certificate must be in either the local computer certificate store or the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] service account certificate store. Use the local computer certificate store to avoid reconfiguring certificates when the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] startup account changes.
2223

2324
- The [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] service account must have the necessary permission to access the TLS certificate. For more information, see [Encrypt connections to SQL Server by importing a certificate](configure-sql-server-encryption.md).
2425

@@ -101,6 +102,65 @@ For more information on SQL clusters, see [Before Installing Failover Clustering
101102

102103
In [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] and later versions, [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Configuration Manager automatically validates all certificate requirements during the configuration phase itself. If [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] successfully starts after you configure a certificate, it's a good indication that [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] can use that certificate. But some client applications might still have other requirements for certificates that can be used for encryption, and you might experience different errors depending on the application being used. In that scenario, you need to check the client application's support documentation for more information on the subject.
103104

105+
### Verify KeySpec and Key Usage
106+
107+
The `KeySpec` requirement (`AT_KEYEXCHANGE`) is a common cause of certificate configuration failures. Use the following methods to verify that your certificate meets this requirement.
108+
109+
#### Use certutil
110+
111+
Run `certutil` with the `-v` option to display detailed certificate properties, including `KeySpec` and `Key Usage`:
112+
113+
```cmd
114+
certutil -v -store My "<certificate_thumbprint>"
115+
```
116+
117+
In the output, look for the following values:
118+
119+
```output
120+
KeySpec = 1 -- AT_KEYEXCHANGE
121+
Key Usage = Key Encipherment, Digital Signature (a0)
122+
Enhanced Key Usage:
123+
Server Authentication (1.3.6.1.5.5.7.3.1)
124+
```
125+
126+
If `KeySpec = 2` (`AT_SIGNATURE`), the certificate can't be used for [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] encryption.
127+
128+
#### Use PowerShell
129+
130+
Run the following PowerShell commands to check `KeySpec` for certificates in the local computer store:
131+
132+
```powershell
133+
Get-ChildItem Cert:\LocalMachine\My | ForEach-Object {
134+
$cert = $_
135+
$key = $cert.PrivateKey
136+
[PSCustomObject]@{
137+
Subject = $cert.Subject
138+
Thumbprint = $cert.Thumbprint
139+
KeySpec = if ($key) { $key.CspKeyContainerInfo.KeyNumber } else { 'No private key' }
140+
NotAfter = $cert.NotAfter
141+
}
142+
} | Format-Table -AutoSize
143+
```
144+
145+
Verify that `KeySpec` shows `Exchange` (corresponding to `AT_KEYEXCHANGE`). If it shows `Signature`, request a new certificate with the correct `KeySpec` setting.
146+
147+
### Create a certificate using AD CS
148+
149+
If your organization uses Active Directory Certificate Services (AD CS) as an internal certificate authority (CA), create a certificate that meets [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] requirements by following these steps:
150+
151+
1. Open the **Certificates** MMC snap-in for the local computer (`certlm.msc`).
152+
1. Expand **Personal**, right-click **Certificates**, and select **All Tasks** > **Request New Certificate**.
153+
1. Select **Active Directory Enrollment Policy** and select **Next**.
154+
1. Choose a certificate template that supports server authentication. A **Web Server** or custom template configured for server authentication typically meets the requirements. Verify with your CA administrator that the template uses a legacy Cryptographic Service Provider (CSP) with `KeySpec = AT_KEYEXCHANGE`, not a Key Storage Provider (KSP).
155+
1. On the **Certificate Properties** page:
156+
- Set the **Common Name (CN)** to the hostname or FQDN of your [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instance.
157+
- On the **Subject Alternative Name** tab, add DNS entries for all hostnames that clients use to connect (hostname, FQDN, and any aliases).
158+
1. Complete the enrollment wizard and verify the new certificate appears in **Personal** > **Certificates**.
159+
1. Verify the `KeySpec` by using certutil or PowerShell as described in [Verify KeySpec and Key Usage](#verify-keyspec-and-key-usage).
160+
161+
> [!IMPORTANT]
162+
> Certificates created with a Key Storage Provider (KSP), such as the **Microsoft Software Key Storage Provider**, use `KeySpec = 0` and aren't compatible with [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)]. When creating your certificate template in AD CS, select a legacy CSP like **Microsoft RSA SChannel Cryptographic Provider** to ensure `KeySpec = AT_KEYEXCHANGE`.
163+
104164
You can use one of the following methods to check the validity of the certificate for use with [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)]:
105165

106166
- **sqlcheck tool**: `sqlcheck` is a command-line tool that examines the current computer and service account settings and produce a text report to the Console window that is useful for troubleshooting various connection errors. The output has the following information regarding certificates:

docs/machine-learning/install/sql-machine-learning-services-windows-install.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: Install SQL Server Machine Learning Services on Windows
33
description: Learn how to install SQL Server Machine Learning Services on Windows to run Python and R scripts in-database.
44
author: VanMSFT
55
ms.author: vanto
6-
ms.date: 09/17/2025
6+
ms.date: 02/27/2026
7+
ai-usage: ai-assisted
78
ms.service: sql
89
ms.subservice: machine-learning-services
910
ms.topic: how-to
@@ -17,9 +18,26 @@ monikerRange: "=sql-server-2016 || =sql-server-2017 || =sql-server-ver15"
1718

1819
This article shows you how to install [SQL Server Machine Learning Services](../sql-server-machine-learning-services.md) on Windows. You can use Machine Learning Services to run Python and R scripts in-database.
1920

20-
> [!IMPORTANT]
21+
> [!IMPORTANT]
2122
> These instructions apply to [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)], [!INCLUDE [sssql17-md](../../includes/sssql17-md.md)], and [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)]. For [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], refer to [Install SQL Server 2022 Machine Learning Services on Windows](sql-machine-learning-services-windows-install-sql-2022.md).
2223
24+
## Python and R version reference
25+
26+
The following table shows the Python and R runtime versions included with each SQL Server release. Use this table to determine which language versions are available for your SQL Server instance.
27+
28+
| SQL Server version | Python version | R version |
29+
|---|---|---|
30+
| [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] | N/A (R only) | 3.2.2 |
31+
| [!INCLUDE [sssql17-md](../../includes/sssql17-md.md)] RTM - CU21 | 3.5.2 | 3.3.3 |
32+
| [!INCLUDE [sssql17-md](../../includes/sssql17-md.md)] CU22 and later | 3.5.2 and 3.7.2 | 3.3.3 and 3.5.2 |
33+
| [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] | 3.7.1 | 3.5.2 |
34+
| [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] | 3.10.2 | 4.2.0 |
35+
36+
> [!NOTE]
37+
> Starting with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], runtimes for R, Python, and Java are no longer installed with SQL Server Setup. Instead, install your desired custom runtimes and packages. For more information, see [Install SQL Server 2022 Machine Learning Services on Windows](sql-machine-learning-services-windows-install-sql-2022.md).
38+
39+
For more information about all supported versions, see [What is SQL Server Machine Learning Services?](../sql-server-machine-learning-services.md#python-and-r-versions)
40+
2341
<a id="bkmk_prereqs"></a>
2442

2543
## Preinstallation checklist
@@ -107,7 +125,7 @@ For local installations, you must run the setup as an administrator. If you inst
107125

108126
- **Python**
109127

110-
Select this option to add the Microsoft Python packages, the Python 3.5 executable, and select libraries from the Anaconda distribution.
128+
Select this option to add the Microsoft Python packages, the Python executable, and select libraries from the Anaconda distribution. For the specific Python version included with your SQL Server release, see [Python and R version reference](#python-and-r-version-reference).
111129

112130
::: moniker range="=sql-server-ver15"
113131
For information on installing and using Java, see [Install SQL Server Java Language Extension on Windows](../../language-extensions/install/windows-java.md).
@@ -387,6 +405,8 @@ To install and manage additional packages, you can set up user groups to share p
387405
388406
## Related content
389407
408+
- [What is SQL Server Machine Learning Services?](../sql-server-machine-learning-services.md)
409+
- [Install SQL Server 2022 Machine Learning Services on Windows](sql-machine-learning-services-windows-install-sql-2022.md)
390410
- [Python Tutorial: Deploy a linear regression model with SQL machine learning](../tutorials/python-ski-rental-linear-regression-deploy-model.md)
391411
- [Python tutorial: Categorizing customers using k-means clustering with SQL machine learning](../tutorials/python-clustering-model.md)
392412
- [Quickstart: Run simple R scripts with SQL machine learning](../tutorials/quickstart-r-create-script.md)

0 commit comments

Comments
 (0)