大网数据广告活动
数据库与应用安全

Use encryption and network packet size

· 52CE 我爱测

This article provides a resolution for the problem that occurs when you configure your SQL Server to use encrypted connections and network packet size option.

This article helps you resolve the problem that occurs when you configure your SQL Server to use encrypted connections and network packet size option.

Original product version:   SQL Server
Original KB number:   2006769

Symptoms

Consider the following scenario for SQL Server environments:

In this scenario, you will notice the following:

  • An attempt to either save SSIS packages to the MSDB package store will fail with the following error message:

    The SaveToSQLServer method has encountered OLE DB error code 0x80004005 (Communication link failure).The SQL statement that was issued has failed.

    [!NOTE] You also run into the above error message when saving maintenance plans created in SQL Server Management Studio as SSIS packages to MSDB databases since that operation inherently uses encryption for connections to SQL Server.

  • Data collector feature in SQL Server that uses SSIS, runs into various issues as noted below:

    • A Data Collection Set job reports the following errors in the Job History:

    dcexec: Error: Internal error at Main (Reason: The system cannot find the file specified).
    dcexec: Error: Internal error at Main (Reason: The handle is invalid).

    • When running a Data Collection Set directly from the Data, you may encounter the following error message:

    Package "Set_{7B191952-8ECF-4E12-AEB2-EF646EF79FEF}_Master_Package_Collection" failed.

If you review the Data Collector logs you will find an error message similar to the following:

SSIS error. Component name: TaskForCollectionItem_1, Code: -1073602332, Subcomponent: (null), Description: Error 0xC0014062 while preparing to load the package. The LoadFromSQLServer method has encountered OLE DB error code 0x80004005 (Communication link failure). The SQL statement that was issued has failed.

The problem could happen with any operation that uses either Application.LoadFromSqlServer(String, String, String, String, IDTSEvents) Method or Application.SaveToSqlServer(Package, IDTSEvents, String, String, String) Method methods when both the conditions (encryption and large packet size) discussed in this section are true.

Cause

Secure Socket Layer (SSL) and its replacement, Transport Layer Security(TLS), limit data fragments to 16k (16384) in size. This is documented in the public RFC 2246 (section 6.2.2) and the current implementation of Network Protocols, and TDS Endpoints layer adheres to this specification. So when using a network packet size that is greater than 16k in environments where encryption is enabled on SQL Server, you will run into errors discussed in the Symptoms section.

Resolution

To resolve this problem, specify a network packet size that is smaller than or equal to 16,384 bytes. You may use the following code to set the network packet size configuration option of the sp_configure system stored procedure:

Note: If MARS is enabled, the SMUX provider will add a 16-byte header to the packet before SSL encryption, reducing the maximum network packet size to 16368 bytes.

EXEC sp_configure 'network packet size', 16368
RECONFIGURE WITH OVERRIDE
GO

The network packet size can also be altered via the Server Properties page in Object Explorer. Select the Advanced option and type in the new value for Network Packet Size and click OK.

Note: You do not need to restart SQL Server for the change to be effective. After this setting is changed, all new connections receive the new value.

More information

TLS vs. SSL

Steps to reproduce

sp_configure 'network packet size', 16384
RECONFIGURE WITH OVERRIDE
GO
  1. Make sure your Data Collector is installed.

  2. Set the Network Packet Size to a value greater than 16K.

  3. Right click on Data Collection in Object Explorer (OE) and Disable Data Collection.

  4. Right click on Data Collection in OE and select Enable Data Collection.

  5. Right click on Server Activity in the collection sets and select Start Data Collection Set.

  6. To get the error, right click on Server Activity and select Collect and Upload Now. (The DC logs show the error in detail).

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 09/15/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。