About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
After a SQL Server upgrade, SQL Server Agent starts and stops straight away, or applications that connected yesterday now report "An existing connection was forcibly closed by the remote host". The number is 10054. Windows raises it in the sockets layer, but Microsoft ties the error in this setting to a failed TLS handshake between the client and SQL Server.
What the error means
Microsoft's page on the error puts it this way: "The error is tied to a failed TLS handshake between the client and SQL Server, often because the client and server can't agree on a TLS protocol version (for example, TLS 1.2 or TLS 1.3) or a cipher suite." The operating system error 10054 "is raised in the Windows sockets layer".
Messages that Microsoft lists for this scenario include:
- "A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host.)"
- "A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)"
For the SQL Server Agent case after an upgrade, a second Microsoft page lists these messages: "SQL Server does not accept the connection (error: 10054). Waiting for SQL Server to allow connections. Operation attempted was: Verify Connection on Start." and "SQLServer Error: 10054, SSL Provider: An Existing connection was forcibly closed by the remote host. [SQLSTATE 08001]". That page says the error "is likely to continue even after you use the local system account for the SQL Server Agent service", so, according to that page, switching the Agent to the local system account is not the fix.
Likely causes
| Cause on Microsoft's pages | What it looks like |
|---|---|
| TLS disabled after the upgrade | The upgrade page: "Sometimes after a Microsoft SQL Server upgrade, TLS is disabled and you might experience a connection error." |
| No matching TLS protocol between client and server | An old ODBC driver, OLE DB provider, .NET Framework component or SQL Server version that doesn't support TLS 1.2 or later |
| Matching protocols but no matching cipher suites | Algorithms restricted on the client or the server; the server closes the connection instead of sending a Server Hello |
| TLS_DHE cipher suites on different Windows versions | Client and server on different Windows versions both advertising TLS_DHE_* suites |
| SQL Server certificate with a weak hash | A certificate with an MD5, SHA224 or SHA512 thumbprint algorithm "doesn't work with TLS 1.2 and causes the error"; self-signed certificates are not affected |
| IOCP worker shortage | Intermittent 10054 on busy systems running SQL Server 2017 or earlier |
Microsoft's table of TLS versions says TLS 1.0 and 1.1 are "Disabled by default on Windows 11, Windows Server 2022, and later" and advises "Don't use. Upgrade clients and servers to TLS 1.2 or later." TLS 1.2 is "Enabled by default on all supported Windows versions." TLS 1.3 is supported on Windows 11 and Windows Server 2022 and later, and by SQL Server 2022 and later with current client drivers.
Prove the cause before changing anything
Everything here only reads.
- Record the exact message and whether it comes from SQL Server Agent, an application, a linked server or SSMS.
- Check the client driver. Microsoft says to confirm the client driver supports TLS 1.2 or later, and that older drivers such as SQL Server Native Client are deprecated and aren't recommended. Microsoft lists as safe baselines the ODBC Driver 17 or 18, OLE DB Driver 18 or 19, .NET Framework 4.6.2 or later, and JDBC Driver 9.4 or later.
- Compare TLS settings on the client and the server. Microsoft's starting points: use
Get-TlsCipherSuiteand the registry keys underHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols. - For cipher suites, Microsoft gives this read-only PowerShell command and says
Get-TlsCipherSuitegives a more readable list on Windows 10, Windows 11, Windows Server 2016 and later:
Get-ItemPropertyValue -Path 'HKLM:\System\CurrentControlSet\Control\Cryptography\Configuration\Local\SSL\00010002\' -Name Functions
- Check the SQL Server error log for the "successfully loaded for encryption" entry, which Microsoft says confirms which certificate is in use, then check its thumbprint algorithm. In SQL Server Configuration Manager, the Certificate tab has a View button for the same check.
- If a network trace is possible, capture at both ends and read the Client Hello and Server Hello packets. If there are no matching suites, Microsoft says the server closes the connection instead of sending a Server Hello.
Example (illustrative): at contoso.com.au SQL05 was upgraded over a weekend. On Monday the line-of-business app on a Windows Server 2012 R2 host, which uses SQLOLEDB, reports error 10054 on every connection. The server's Protocols registry keys show TLS 1.0 and 1.1 turned off, and SQLOLEDB is one of the deprecated components Microsoft names. The client cannot negotiate a protocol that the server offers.
Fix
Choose from what the proof showed. Microsoft's first recommendation for a protocol mismatch is to upgrade SQL Server or the client providers to a version that supports TLS 1.2, and where possible TLS 1.3. That is a software change by whoever owns the application.
Short-term: enable an older TLS version
Microsoft's TLS page allows a short-term workaround: "As a short-term workaround, ask your system administrators to temporarily enable TLS 1.0 or TLS 1.1 on both the client and the server. Do this only until the components can be upgraded." The upgrade page's version of the fix is to enable TLS by setting registry entries under SCHANNEL\Protocols for TLS1.0, TLS1.1 and TLS1.2, and restart the computer.
Microsoft's registry page says how a protocol version is switched. The setting is a DWORD value named Enabled under a version-specific subkey of HKLM SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols. Value 1 enables, 0 disables, and the subkeys are named like TLS 1.2\Server and TLS 1.2\Client, with a space in the version name and separate Client and Server subkeys.
The two Microsoft pages disagree on key names. The upgrade page lists Protocols\TLS1.0, Protocols\TLS1.1 and Protocols\TLS1.2, without a space and without Client or Server subkeys. The registry page is the one that documents the Schannel keys and warns that registry settings it does not detail are not recommended, so use its names (TLS 1.0\Server, TLS 1.0\Client and so on) and do not create keys named without the space. Look at which subkeys already exist on the machine before you create anything.
Save first. Record the current state of the Protocols key with this command from an elevated Command Prompt, using a file name that does not exist yet:
reg export "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols" protocols-before.reg
If the command reports that the key cannot be found, there is nothing to save, and your way back is to delete what you add. In Registry Editor, also write down every subkey under Protocols, and for each the value of Enabled if one exists (or that there is none). Do the same on the client machine.
Disruptive step: The next change enables an older, weaker TLS version for every program on that computer that uses Windows' Schannel. Microsoft says TLS versions earlier than 1.2 "have several known vulnerabilities", and its registry page cautions that incorrect registry values "can result in unrecoverable errors in the system". The upgrade page also says to restart the computer for the change to apply, which drops every connection on it. Do it in a maintenance window, on a computer you have a console to, and plan the removal of the setting on the day you do it.
- In Registry Editor, under
Protocols, go to the version subkey for the client or server role that needs it, creating the subkey first if it does not exist. - Create the DWORD value
Enabledwith the value 1, or set it to 1 if it exists. - Restart the computer.
To undo it: set Enabled back to the value you wrote down, or delete the Enabled value if you created it, delete any subkey you created if it is now empty, and restart the computer. Do the same on the client. Do not run reg import on the saved file for this purpose; importing only adds or overwrites values and does not remove ones you created. Take this step as soon as the application is upgraded.
Certificate with a weak hash
Microsoft's fix: in SQL Server Configuration Manager open the Certificate tab of Protocols for the instance. If a certificate appears, select View to check its thumbprint algorithm and, if it is weak, select Clear and go on to the Certificates snap-in. If none appears, find the hash in the error log. In both cases, remove Server Authentication from that certificate in the Certificates snap-in and restart the SQL Server service. The page explains why the last part is needed: if SQL Server finds a certificate in the certificate store that supports server authentication, it uses that certificate "even if it wasn't manually provisioned", so a cleared certificate that still has Server Authentication can be picked up again.
Save first. On the Certificate tab write down the certificate's name and thumbprint, or, if the tab shows none, the hash from the error log. Then open the weak certificate's Properties in the Certificates snap-in for the Computer account and take a screenshot of the General tab, which shows its current purposes setting.
Disruptive step: The next steps clear the instance's server certificate if one is set, remove Server Authentication from the weak certificate in the Certificates snap-in, and restart the SQL Server service. Every connection to the instance drops during the restart, and the instance then uses the certificate SQL Server chooses itself. Clients that require a particular certificate may fail afterwards. Every other service that uses the same certificate for server authentication is affected by the snap-in change.
- On the Certificate tab, if a certificate appears, select Clear. If none appears, note the hash from the error log, as saved above.
- In both cases, open the Certificates snap-in for the Computer account, find the certificate in Personal by name or thumbprint, open its Properties, and on the General tab select "Enable only the following purposes" and clear Server Authentication.
- Restart the SQL Server service.
To undo it: on the General tab of the certificate's Properties, put the purposes setting back as you saved it (tick Server Authentication again). If you cleared a certificate on the Certificate tab, select the certificate you wrote down there and apply. Then restart the service.
Cipher suites and the other rows
For no matching cipher suites, Microsoft says to check the Cipher Suites tab in the IIS Crypto tool; if no matching algorithm exists "contact Microsoft Support". For TLS_DHE_* suites on mixed Windows versions it says to remove all suites that start with TLS_DHE_ from the local policy. The page gives no steps for either, so none are given here. For IOCP shortages on SQL Server 2017 or earlier, Microsoft says SQL Server 2019 and later "include several performance improvements" and to plan an upgrade.
Confirm the fix
- Restart SQL Server Agent where it was failing and check that it stays running.
- Connect from the failing client and confirm the login completes.
- Read the new error log and confirm the 10054 entries have stopped.
What to watch afterwards
- Any registry change made as a workaround. Microsoft says it is only until the components are upgraded, so put the date it must be removed in the change record.
- Clients still using SQL Server Native Client or SQLOLEDB. Microsoft says to replace them.
- Group Policy or registry settings that disable older protocols. Microsoft notes that administrators also push these out in older environments.
Read next
Related articles you may want next.
- Troubleshooting'The certificate chain was issued by an authority that is not trusted' after a SQL Server driver upgradeA SqlClient 4.0+ upgrade turned on Encrypt and certificate checks. Find which certificate fault applies, fix it on the server and keep validation on.Read article
- HostingSQL Server support dates for hosted applications: what ended, what ends next, and upgrade checksWhich SQL Server versions still receive security updates, what Extended Security Updates require outside Azure, which versions can upgrade directly to SQL Server 2025, and what to check before an upgrade of a hosted business application.Read article
- TroubleshootingSQL Server 'A network-related or instance-specific error occurred' (error 26, 40, 53): find where the connection stops'Error Locating Server/Instance Specified' (error 26) or error 40: check the service, instance name, TCP, port, Browser UDP 1434 and firewall in order.Read article
Risks and limits
These steps have not been run in a lab. Microsoft's upgrade page names SQL Server Standard Edition and gives no version range, and it lists registry paths without the values to set; the values here come from Microsoft's separate registry page. Enabling TLS 1.0 or 1.1 lowers security on that computer; the workaround is Microsoft's, and it is temporary by Microsoft's own wording.
Sources
- An existing connection was forcibly closed by the remote host (OS error 10054) — Microsoft Learn, page dated 2026-05-27, accessed 1 December 2026
- A connection error 10054 might occur post SQL Server upgrade — Microsoft Learn, page dated 2024-05-01, accessed 1 December 2026
- Transport Layer Security (TLS) registry settings — Microsoft Learn, page dated 2025-04-18, accessed 1 December 2026
This article was originally published on .