Skip to content

Commit e0ca557

Browse files
PiJoCoderrwestMSFTVanMSFTMashaMSFTDavid-Engel
authored
Update and clarify TL1.3 and TDS 8.0 usage [PLEASE SQUASH BEFORE MERGE] (#35077)
* Update and clarify TL1.3 and TDS 8.0 usage * Apply suggestions from code review * Apply suggestions from review Co-authored-by: Van To <40007119+VanMSFT@users.noreply.github.com> Co-authored-by: Masha Thomas (MSFT) <32783170+MashaMSFT@users.noreply.github.com> * table update * table update * Apply suggestions from review Co-authored-by: David Engel <dengel1012@gmail.com> * creating breaks in table * Fix formatting in TDS 8.0 encryption options table * reverting line breaks in table * Added breaks back in * adding another break for separation --------- Co-authored-by: Randolph West MSFT <97149825+rwestMSFT@users.noreply.github.com> Co-authored-by: Van To <40007119+VanMSFT@users.noreply.github.com> Co-authored-by: Masha Thomas (MSFT) <32783170+MashaMSFT@users.noreply.github.com> Co-authored-by: David Engel <dengel1012@gmail.com>
1 parent 9cdf4b7 commit e0ca557

1 file changed

Lines changed: 36 additions & 10 deletions

File tree

  • docs/relational-databases/security/networking

docs/relational-databases/security/networking/tds-8.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: TDS 8.0
33
description: This article discusses TDS 8.0, the application layer protocol used by clients to connect to SQL Server.
44
author: VanMSFT
55
ms.author: vanto
6-
ms.reviewer: randolphwest
7-
ms.date: 08/18/2025
6+
ms.reviewer: randolphwest, jaferebe, jopilov
7+
ms.date: 09/04/2025
88
ms.service: sql
99
ms.subservice: security
1010
ms.topic: conceptual
@@ -23,13 +23,13 @@ The [Tabular Data Stream (TDS)](/openspecs/windows_protocols/ms-tds/b46a581a-39d
2323

2424
TDS is a secure protocol, but in previous versions of SQL Server, encryption could be turned off or not enabled. To meet the standards of mandatory encryption while using SQL Server, an iteration of the TDS protocol was introduced: TDS 8.0.
2525

26-
The TLS handshake now precedes any TDS messages, wrapping the TDS session in TLS to enforce encryption, making TDS 8.0 aligned with HTTPS and other web protocols. This significantly contributes to TDS traffic manageability, as standard network appliances are now able to filter and securely passthrough SQL queries.
26+
The TLS handshake now precedes any TDS messages, wrapping the TDS session in TLS to enforce encryption, aligning TDS 8.0 with HTTPS and other web protocols. This enhancement significantly contributes to TDS traffic manageability, as standard network appliances are now able to filter and securely passthrough SQL queries.
2727

28-
Another benefit to TDS 8.0 compared to previous TDS versions is compatibility with TLS 1.3, and TLS standards to come. TDS 8.0 is also fully compatible with TLS 1.2 and previous TLS versions.
28+
A benefit to TDS 8.0 compared to previous TDS versions is its compatibility with TLS 1.3, and TLS standards to come. TDS 8.0 is also fully compatible with TLS 1.2 and previous TLS versions.
2929

3030
## How TDS works
3131

32-
The Tabular Data Stream (TDS) protocol is an application-level protocol used for the transfer of requests and responses between clients and database server systems. In such systems, the client typically establishes a long-lived connection with the server. Once the connection is established using a transport-level protocol, TDS messages are used to communicate between the client and the server.
32+
The Tabular Data Stream (TDS) protocol is an application-level protocol used for the transfer of requests and responses between clients and database server systems. The client system typically establishes a long-lived connection with the server. Once the connection is established using a transport-level protocol, TDS messages are exchanged to communicate between the client and SQL Server.
3333

3434
During the TDS session lifespan, there are three phases:
3535

@@ -45,6 +45,32 @@ With the introduction of TDS 8.0, the SQL Server connections are as follows:
4545

4646
TCP handshake :arrow_right: TLS handshake :arrow_right: TDS prelogin (encrypted) and response (encrypted) :arrow_right: authentication (encrypted) :arrow_right: data exchange (encrypted)
4747

48+
## Compatibility matrix for TDS, TLS, OS and encryption options
49+
50+
You can enable both TLS 1.2 and TLS 1.3 versions at the OS level, which allows client connections to SQL Server to use multiple TDS protocol versions (TDS 7.x and 8.0). Depending on the OS version, TLS 1.2 and TLS 1.3 might be enabled by default.
51+
52+
Only TDS 7.x supports non-encrypted (optional) communication, TDS 8.0 doesn’t support this. TDS 7.x supports encryption using TLS up to version 1.2. TDS 8.0 requires encryption – everything is always encrypted with TDS 8.0 (Encrypt=Strict). TDS 8.0 has no minimum TLS version requirement and supports TLS 1.3.
53+
TLS 1.3 support is dependent on the operating system version. The following table summarizes various scenarios with the encryption options and the corresponding TLS and TDS versions.
54+
55+
56+
| Encrypt<br />option | TLS version enabled | OS version | Expected<br />connection<br />outcome | Notes |
57+
| --- | --- | --- | --- | --- |
58+
| Strict | TLS 1.3 only (or later) | Windows 11<br /><br />Windows Server 2022 and later | Success | TLS 1.3 negotiated; TDS 8.0 triggered (Encrypt=Strict) |
59+
| Strict | TLS 1.2 and TLS 1.3 | Windows 11<br /><br />Windows Server 2022 and later | Success | TLS 1.3 negotiated; TDS 8.0 triggered (Encrypt=Strict) |
60+
| Strict | TLS 1.2 only (or earlier) | Windows 11<br /><br />Windows Server 2022 and later | Success | TLS 1.2 negotiated; TDS 8.0 triggered (Encrypt=Strict) |
61+
| Strict | TLS 1.2 only (or earlier) | Windows 10<br /><br />Windows Server 2019 / 2016 | Success | TLS 1.2 negotiated; TDS 8.0 triggered (TLS 1.3 not available) |
62+
| Mandatory | TLS 1.3 only (or later) | Windows 11<br /><br />Windows Server 2022 and later | Failure | Encrypt=Mandatory is incompatible with TLS 1.3 for TDS 8.0 |
63+
| Mandatory | TLS 1.2 and TLS 1.3 | Windows 11<br /><br />Windows Server 2022 and later | Success | TLS 1.2 negotiated; TDS 8.0 not triggered (Encrypt=Mandatory) |
64+
| Mandatory | TLS 1.2 only (or earlier) | Windows 11<br /><br />Windows Server 2022 and later | Success | TLS 1.2 negotiated; TDS 8.0 not triggered (Encrypt=Mandatory) |
65+
| Mandatory | TLS 1.2 only (or earlier) | Windows 10<br /><br />Windows Server 2019 / 2016 | Success | TLS 1.2 negotiated; TDS 8.0 not supported on this OS (uses TDS 7.x) |
66+
| Optional | TLS 1.3 only (or later) | Windows 11<br /><br />Windows Server 2022 and later | Failure | Encrypt=Optional (false) is TDS 7.x, which is incompatible with TLS 1.3. |
67+
| Optional | TLS 1.2 and TLS 1.3 | Windows 11<br /><br />Windows Server 2022 and later | Success | TLS 1.3 negotiated; TDS 8.0 not triggered (Encrypt=Optional) |
68+
| Optional | TLS 1.2 only (or earlier) | Windows 11<br /><br />Windows Server 2022 and later | Success | TLS 1.2 negotiated; TDS 8.0 not triggered (Encrypt=Optional) |
69+
| Optional | TLS 1.2 only (or earlier) | Windows 10<br /><br />Windows Server 2019 / 2016 | Success | TLS 1.2 negotiated; encryption optional; connection can <br />succeed without encryption |
70+
| Any | TLS 1.3 only (or later) | Windows 10<br /><br />Windows Server 2019 / 2016 | Failure | TLS 1.3 not supported on this OS |
71+
72+
For more information on how clients use different TDS versions, see the keywords usage in [Changes to connection string encryption properties](#additional-changes-to-connection-string-encryption-properties) section.
73+
4874
## SQL Server 2025 support
4975

5076
[!INCLUDE [sssql25-md](../../../includes/sssql25-md.md)] introduces TDS 8.0 support for the following command-line tools and SQL Server features:
@@ -67,7 +93,7 @@ TCP handshake :arrow_right: TLS handshake :arrow_right: TDS prelogin (encrypted)
6793

6894
## Strict connection encryption
6995

70-
To use TDS 8.0, [!INCLUDE [sssql22-md](../../../includes/sssql22-md.md)] added `strict` as an additional connection encryption type to SQL Server drivers (`Encrypt=strict`). To use the `strict` connection encryption type, download the latest version of the .NET, ODBC, OLE DB, JDBC, PHP, and Python drivers.
96+
To use TDS 8.0, [!INCLUDE [sssql22-md](../../../includes/sssql22-md.md)] added `strict` as an additional connection encryption option to SQL Server drivers (`Encrypt=strict`). To use the `strict` connection encryption type, download the latest version of the .NET, ODBC, OLE DB, JDBC, PHP, and Python drivers:
7197

7298
- [Microsoft ADO.NET for SQL Server and Azure SQL Database](../../../connect/ado-net/microsoft-ado-net-sql-server.md) version 5.1 or higher
7399
- [ODBC Driver for SQL Server](../../../connect/odbc/download-odbc-driver-for-sql-server.md) version 18.1.2.1 or higher
@@ -76,7 +102,7 @@ To use TDS 8.0, [!INCLUDE [sssql22-md](../../../includes/sssql22-md.md)] added `
76102
- [Microsoft Drivers for PHP for SQL Server](../../../connect/php/microsoft-php-driver-for-sql-server.md) version 5.10 or higher
77103
- [Python SQL Driver - pyodbc](../../../connect/python/pyodbc/python-sql-driver-pyodbc.md)
78104

79-
In order to prevent a man-in-the-middle attack with `strict` connection encryption, users aren't able to set the `TrustServerCertificate` option to `true` and trust any certificate the server provided. Instead, users would use the `HostNameInCertificate` option to specify the certificate `ServerName` that should be trusted. The certificate supplied by the server would need to pass the certificate validation.
105+
In order to prevent a man-in-the-middle attack with `strict` connection encryption, users can't set the `TrustServerCertificate` option to `true` and allow any certificate the server provided. Instead, users would use the `HostNameInCertificate` option to specify the certificate `ServerName` that should be trusted. The certificate supplied by the server would need to pass the certificate validation. For more information on certificate validation, see [Certificate requirements for SQL Server](../../../database-engine/configure-windows/certificate-requirements.md)
80106

81107
### Features that don't support forcing strict encryption
82108

@@ -88,12 +114,12 @@ The following features or tools still use previous version of drivers that don't
88114

89115
## Additional changes to connection string encryption properties
90116

91-
The following additions are added to connection strings for encryption:
117+
The following options are added to connection strings to encrypt communication:
92118

93119
| Keyword | Default | Description |
94120
| --- | --- | --- |
95-
| `Encrypt` | `false` | **Existing behavior**<br /><br />When `true`, SQL Server uses TLS encryption for all data sent between the client and server if the server has a certificate installed. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](/dotnet/framework/data/adonet/connection-string-syntax).<br /><br />**Change of behavior**<br /><br />When set to `strict`, SQL Server uses TDS 8.0 for all data sent between the client and server.<br /><br />When set to `mandatory`, `true`, or `yes`, SQL Server uses TDS 7.x with TLS/SSL encryption for all data sent between the client and server if the server has a certificate installed.<br /><br />When set to `optional`, `false`, or `no`, the connection uses TDS 7.x and would be encrypted only if required by the SQL Server. |
96-
| `TrustServerCertificate` | `false` | **Existing behavior**<br /><br />Set to `true` to specify that the driver doesn't validate the server TLS/SSL certificate. If `true`, the server TLS/SSL certificate is automatically trusted when the communication layer is encrypted using TLS.<br /><br />If `false`, the driver validates the server TLS/SSL certificate. If the server certificate validation fails, the driver raises an error and closes the connection. The default value is `false`. Make sure the value passed to `serverName` exactly matches the `Common Name (CN)` or DNS name in the `Subject Alternative Name` in the server certificate for a TLS/SSL connection to succeed.<br /><br />**Change of behavior for Microsoft ODBC Driver 18 for SQL Server**<br /><br />If `Encrypt` is set to `strict`, this setting specifies the location of the certificate to be used for server certificate validation (exact match). The driver supports PEM, DER, and CER file extensions.<br /><br />If `Encrypt` is set to `true` or `false`, and the `TrustServerCertificate` property is unspecified or set to `null`, `true`, or `false`, the driver uses the `ServerName` property value on the connection URL as the host name to validate the SQL Server TLS/SSL certificate. |
121+
| `Encrypt` | *false* | **Previous connection string options**<br /><br />Valid options are <br />- `true`, or `yes` <br /> - `false`, or `no`. <br /> For more information, see [Connection String Syntax](/dotnet/framework/data/adonet/connection-string-syntax#enable-encryption). When `true`, SQL Server uses TLS 1.2 encryption for all data exchanged between the client and server if the server has a certificate installed.<br /><br />**Latest connection string options**<br /><br />Valid options are <br/>- `strict` <br />- `mandatory`, or `true`, or `yes` <br />- `optional`, or `false`, or `no`. <br /><br />When set to `strict`, SQL Server uses TDS 8.0 for all data exchanged between the client and server.<br /><br />When set to `mandatory`, `true`, or `yes`, SQL Server uses TDS 7.x with TLS/SSL encryption for all data sent between the client and server if the server has a certificate installed.<br /><br />When set to `optional`, `false`, or `no`, the connection uses TDS 7.x and would be encrypted only if required by the SQL Server. |
122+
| `TrustServerCertificate` | *false* | **Previous connection string option**<br /><br />When set to `true` (not recommended), the driver doesn't validate the server TLS/SSL certificate. If `true`, the server TLS/SSL certificate is automatically trusted (bypassing validation) when the communication layer is encrypted using TLS.<br /><br />If `false`, the driver validates the server TLS/SSL certificate. If the server certificate validation fails, the driver raises an error and closes the connection. The default value is `false`. Make sure the value passed to `serverName` exactly matches the `Common Name (CN)` or DNS name in the `Subject Alternate Name` in the server certificate for a TLS/SSL connection to succeed.<br /><br />**Change of behavior for Microsoft SQL Server ODBC Driver 18 and later**<br /><br />If `Encrypt` is set to `strict`, this setting specifies the location of the certificate to be used for server certificate validation (exact match). The driver supports PEM, DER, and CER file extensions.<br /><br />If `Encrypt` is set to `true` or `false`, and the `TrustServerCertificate` property is unspecified or set to `null`, `true`, or `false`, the driver uses the `ServerName` property value on the connection URL as the host name to validate the SQL Server TLS/SSL certificate. |
97123
| `HostNameInCertificate` | `null` | The host name to be used in validating the SQL Server TLS/SSL certificate. If the `HostNameInCertificate` property is unspecified or set to `null`, the driver uses the `ServerName` property value as the host name to validate the SQL Server TLS/SSL certificate. |
98124

99125
## Related content

0 commit comments

Comments
 (0)