giip
SES Proposal
SQL Server接続エラーTLSバージョン互換性移行

Why TLS 1.2 Connections Fail with SQLNCLI10, and Migrating to MSOLEDBSQL 19

公開日 2026-08-13 · 更新日 2026-08-13 · 最終検証日 2026-08-13

結論

SQLNCLI10 (SQL Server Native Client 10.0) is an old-generation driver, and a TLS 1.2 connection requires support on both the OS side and the driver side. The classic trigger is disabling TLS 1.0/1.1 on the server, which then makes this driver unable to connect. The currently recommended path is migrating to the Microsoft OLE DB Driver (MSOLEDBSQL19), but the 19.x series defaults to `Encrypt=yes`, so existing connections fail in environments where the certificate is not trusted.

この文書の適用条件

対象製品SQL Server (all versions) / Amazon RDS for SQL Server (client-side OLE DB driver)
確認バージョンVerify before relying on this (the update build required for TLS 1.2 support varies by product and OS)
適用環境On-premises, EC2, Amazon RDS, Azure (the client is Windows)
必要権限Checking the server version requires connection permission. Checking connection state requires VIEW SERVER STATE. Installing a client driver and checking the registry requires administrator privileges
実行影響The check commands are read-only. Swapping drivers and changing TLS settings affect every client/server connection
再起動Changing OS TLS settings or swapping drivers may require restarting the application or the OS
最終検証日2026-08-13

そのまま実行できるコマンド

Check the server's version and update level参照のみ
対象
SQL Server 2008 and later / Amazon RDS for SQL Server
権限
Connection permission to the target instance
変更作業
None (read-only)
Production実行
Safe to run
-- 対象: SQL Server 2008 以降 / Amazon RDS for SQL Server
-- 権限: 対象インスタンスへの接続権限
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
SELECT
    @@VERSION                             AS version_string,
    SERVERPROPERTY('ProductVersion')      AS product_version,
    SERVERPROPERTY('ProductLevel')        AS product_level,
    SERVERPROPERTY('ProductUpdateLevel')  AS product_update_level,  -- 版によっては NULL
    SERVERPROPERTY('Edition')             AS edition,
    SERVERPROPERTY('MachineName')         AS machine_name;

The update required for TLS 1.2 support varies by SQL Server version and OS. Cross-reference the build number you get here against the vendor's published TLS 1.2 support information. This article deliberately avoids citing specific KB or build numbers. `ProductUpdateLevel` returns NULL on older versions.

Check which driver and encryption state current connections are using参照のみ
対象
SQL Server 2008 and later / Amazon RDS for SQL Server
権限
VIEW SERVER STATE
変更作業
None (read-only)
Production実行
Safe to run
-- 対象: SQL Server 2008 以降 / Amazon RDS for SQL Server
-- 権限: VIEW SERVER STATE
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
SELECT
    c.session_id,
    s.login_name,
    s.host_name,
    s.program_name,
    s.client_interface_name,   -- 使用中のクライアントライブラリ
    s.client_version,
    c.net_transport,
    c.protocol_type,
    c.protocol_version,
    c.encrypt_option,          -- TRUE なら接続が暗号化されている
    c.auth_scheme,
    c.client_net_address,
    c.connect_time
FROM sys.dm_exec_connections AS c
INNER JOIN sys.dm_exec_sessions AS s
        ON c.session_id = s.session_id
WHERE s.is_user_process = 1
ORDER BY c.connect_time DESC;

Use this before migrating to understand which client libraries are actually connecting, and how many. `client_interface_name` and `program_name` let you find applications still using an old driver. `encrypt_option` shows whether encryption is in use, but does not tell you the TLS version.

Rewrite the connection string (from SQLNCLI10 to MSOLEDBSQL19)
対象
Windows client (OLE DB connection)
権限
Permission to change the application configuration
変更作業
Yes (changes the behavior of connection encryption and certificate validation)
Production実行
Verify in a test environment first, then follow your change management process
-- 対象: Windows クライアント(OLE DB 接続)
-- 権限: アプリケーション構成の変更権限
-- 変更作業: あり(暗号化と証明書検証の挙動が変わる)
-- Production 実行: 検証環境での確認と変更管理の手順が前提

-- 1) 移行前(SQL Server Native Client 10.0 / 非推奨)
Provider=SQLNCLI10;Data Source=192.0.2.10,1433;Initial Catalog=SampleDB;User ID=sample_user;Password=********;

-- 2) 移行後(Microsoft OLE DB Driver 19 / 既定で Encrypt=yes)
Provider=MSOLEDBSQL19;Data Source=192.0.2.10,1433;Initial Catalog=SampleDB;User ID=sample_user;Password=********;Encrypt=yes;TrustServerCertificate=no;

-- 3) サーバー証明書を信頼できない場合の暫定回避(検証を弱めるため恒久運用には使わない)
Provider=MSOLEDBSQL19;Data Source=192.0.2.10,1433;Initial Catalog=SampleDB;User ID=sample_user;Password=********;Encrypt=yes;TrustServerCertificate=yes;

-- 4) 18 系以前の MSOLEDBSQL(既定は Encrypt=no のため従来の接続文字列がそのまま動く)
Provider=MSOLEDBSQL;Data Source=192.0.2.10,1433;Initial Catalog=SampleDB;User ID=sample_user;Password=********;

MSOLEDBSQL 19 changed its default to `Encrypt=yes`. As a result, a configuration that previously connected without encryption can start failing on a certificate validation error from simply swapping the driver to 19, even with no connection-string change. The permanent fix is deploying a trusted certificate on the server; `TrustServerCertificate=yes` is a stopgap that skips server certificate validation. It weakens protection against man-in-the-middle attacks, so use it only with an expiration in mind.

Check installed client drivers (read-only)参照のみ
対象
Windows client
権限
Read permission on the registry (administrator privileges depending on the environment)
変更作業
None (read-only)
Production実行
Safe to run
# 対象: Windows クライアント
# 権限: レジストリの参照権限(環境により管理者権限)
# 変更作業: なし(参照のみ)
# Production 実行: 可能

# インストール済みの SQL Server クライアントドライバーを一覧する
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' |
    Where-Object {
        $_.DisplayName -like '*SQL Server*Native Client*' -or
        $_.DisplayName -like '*OLE DB Driver*for SQL Server*'
    } |
    Select-Object DisplayName, DisplayVersion |
    Sort-Object DisplayName

# OS の SCHANNEL プロトコル設定を参照する(変更はしない)
Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols' -Recurse |
    ForEach-Object {
        [PSCustomObject]@{
            Path     = $_.Name
            Settings = (Get-ItemProperty -Path $_.PSPath | Select-Object Enabled, DisabledByDefault)
        }
    }

This checks the driver version and which of TLS 1.0 / 1.1 / 1.2 are enabled on the OS side. Changing the SCHANNEL registry values affects OS-wide communication and requires a restart, so this procedure is read-only. If the relevant key does not exist, the OS default behavior applies.

Isolate the cause with connection tests (comparing with and without encryption)
対象
Windows client (OLE DB connection)
権限
Test connection credentials
変更作業
None (connection test only)
Production実行
Safe (test connections only)
-- 対象: Windows クライアント(OLE DB 接続)
-- 権限: テスト用の接続情報
-- 変更作業: なし(接続テストのみ)
-- Production 実行: 可能(テスト接続のみ)

-- .udl ファイルや接続テストツールで、以下の3パターンを順に試して切り分ける
-- A) 暗号化なし        : Encrypt=no
-- B) 暗号化あり・検証あり: Encrypt=yes;TrustServerCertificate=no
-- C) 暗号化あり・検証なし: Encrypt=yes;TrustServerCertificate=yes

-- A が成功し B が失敗 → 証明書の問題(サーバー証明書またはクライアントの信頼ストア)
-- A も B も失敗       → TLS バージョンまたはドライバー側の問題
-- B が失敗し C が成功 → サーバー証明書が信頼されていない(恒久対策は証明書の是正)

The combination of which of the three patterns succeeds or fails quickly tells you whether the cause is a "certificate" issue or a "TLS version / driver" issue. Do not keep running on pattern C just because it succeeds — it is only meant to isolate the cause.

結果の読み方

意味確認するポイント
product_versionSQL Server's build numberCross-reference with the vendor's TLS 1.2 support information to judge whether the needed update is applied
product_levelService pack levelIf still on an old service pack, the TLS 1.2 support update may not be included
client_interface_nameName of the client library used for the connectionIf anything in the SQLNCLI family shows up, it is a migration target — tally the count and the application
program_nameName of the originating applicationUsed to identify the application that needs migrating
encrypt_optionWhether the connection is encryptedTRUE means encrypted, but this does not tell you the TLS version
protocol_versionTDS protocol versionAn extremely old value indicates an old-generation client is connecting
client_net_addressOriginating addressIdentify which server is connecting with the old driver
DisplayName / DisplayVersion (client)Name and version of the installed driverWhether SQLNCLI10 / SQLNCLI11 remain, and which generation of MSOLEDBSQL is installed

こういう状況で使います

  • A specific application stopped being able to connect right after TLS 1.0 / 1.1 was disabled on the server
  • A communication-break error appears, such as "An existing connection was forcibly closed by the remote host"
  • After swapping the driver to MSOLEDBSQL 19, a connection string that had been working started throwing a certificate error
  • A client from the SQL Server 2008 generation cannot connect to a newly built instance on AWS
  • A new client can connect to the same server, but an old client cannot

考えられる原因(可能性の高い順)

  1. 01

    SQLNCLI10 does not support TLS 1.2

    SQL Server Native Client 10.0 predates the widespread adoption of TLS 1.2. A TLS 1.2 connection requires support on both the OS and product side, and in some environments, even applying the relevant update does not fully meet the requirement. Verify whether an update applies using the target environment and the vendor's support information.

  2. 02

    TLS 1.0 / 1.1 was disabled on the server or OS

    Disabling older protocols to meet security requirements leaves any client that can only speak those protocols unable to connect. If the timing of disabling the protocol lines up with when connections started failing, this is likely the cause.

  3. 03

    MSOLEDBSQL 19's default changed to Encrypt=yes

    Driver version 19.x changed the connection-string default to encryption-on. In environments where the server certificate is not trusted, swapping the driver alone can cause failures even without changing the connection string.

  4. 04

    The server certificate is not trusted

    This covers a self-signed certificate, a mismatch between the hostname and the certificate subject, or a missing certificate chain. If it fails with `Encrypt=yes;TrustServerCertificate=no` but succeeds with `TrustServerCertificate=yes`, this is the cause.

  5. 05

    The SQL Server side is missing the TLS 1.2 support update

    Older versions of SQL Server need the relevant update applied to handle TLS 1.2. The applicable build varies by product, so cross-reference the build number from `SELECT @@VERSION` against the vendor's support information.

  6. 06

    A setting in .NET or another client stack

    Sometimes the protocol in use is fixed by the application framework rather than the OLE DB driver. If updating the driver does not resolve it, check the client stack's settings as well.

確認手順

  1. 1

    Get the server's version and build

    参照のみ

    Record the results of `SELECT @@VERSION` and `SERVERPROPERTY`, and cross-reference against the vendor's TLS 1.2 support information.

  2. 2

    Enumerate connected client libraries

    参照のみ

    Check `client_interface_name` via `sys.dm_exec_connections` and `sys.dm_exec_sessions` to identify connections from an old driver.

  3. 3

    Check installed drivers on the client side

    参照のみ

    Check which of SQLNCLI10 / SQLNCLI11 / MSOLEDBSQL (and which generation) is installed.

  4. 4

    Check the OS's SCHANNEL settings

    参照のみ

    Check whether TLS 1.0 / 1.1 / 1.2 are enabled or disabled. Read-only — no changes at this stage.

  5. 5

    Run connection tests with and without encryption

    Compare the success/failure of `Encrypt=no` / `Encrypt=yes;TrustServerCertificate=no` / `Encrypt=yes;TrustServerCertificate=yes` to isolate whether the cause is the certificate or TLS itself.

  6. 6

    Cross-reference the change history against when the failure started

    参照のみ

    Check whether disabling a protocol on the server, swapping the driver, or renewing a certificate lines up with when connections stopped working.

対応方法

すぐに実施できる低リスクの対応

  • Narrow the cause to certificate vs. TLS with connection tests

    Use the three-pattern test to isolate it. Because the remediation differs completely between the two, do this isolation first.

  • Temporarily restore the connection with `TrustServerCertificate=yes`

    A stopgap once you've confirmed the cause is the certificate. This weakens protection by skipping server certificate validation — use it only with a deadline and a plan for the permanent fix.

事前検討が必要な変更

  • Migrate to MSOLEDBSQL (the current generation)

    SQL Server Native Client is no longer recommended for new development. Migrate to the current Microsoft OLE DB Driver for SQL Server. Since the 19.x series defaults to `Encrypt=yes`, revise the connection string as part of the same change.

  • Deploy a trusted certificate on the server

    Make the certificate's subject match the hostname used at connection time, and deploy the certificate chain to the client's trust store. Being able to connect with `TrustServerCertificate=no` is the permanent fix.

  • Apply the necessary updates to SQL Server and the OS

    The update needed for TLS 1.2 support varies by product and OS. Cross-reference the build number against the vendor's support information and plan the rollout. Applying it involves a restart.

  • Inventory the originating applications

    参照のみ

    Tally `client_interface_name` to list applications still using an old driver, and decide the order in which to migrate them.

再起動・サービス影響を伴う変更

  • Change the OS's TLS protocol settings

    専門家レビュー必須

    Changing the SCHANNEL registry affects OS-wide communication and requires a restart. Since non-SQL-Server traffic changes too, this assumes a server-wide impact assessment.

  • A temporary compatibility configuration to support old clients

    専門家レビュー必須

    Choosing to keep an older protocol alive because migration cannot finish in time requires reconciling it with security requirements. State a deadline and a fallback, and get approval before doing this.

!注意事項

  • The update build required for TLS 1.2 support varies by SQL Server version and OS. This article deliberately omits specific KB or build numbers — cross-reference the build number from `SELECT @@VERSION` against the vendor's published support information.
  • `TrustServerCertificate=yes` skips server certificate validation. The traffic itself is still encrypted, but there is no confirmation that the server you are connecting to is legitimate. Do not leave this as a permanent setting.
  • MSOLEDBSQL 19 defaults to `Encrypt=yes`. Simply swapping the driver, even without changing the connection string, can cause existing connections to fail. Verify in a test environment before swapping it in production.
  • SQL Server Native Client (SQLNCLI / SQLNCLI11) is not recommended for new development. Even for an existing system, check the availability of updates before planning a migration.
  • Changing the OS SCHANNEL settings affects server-wide communication, including non-SQL-Server traffic, and requires a restart. Do not make this decision unilaterally from the database side.
  • If a password is written directly into a connection string, also review how the configuration file is managed (access control, encryption).

バージョン・環境による違い

SQL Server Native Client 10.0 (SQLNCLI10)A driver from the SQL Server 2008 generation. A TLS 1.2 connection requires support from both the OS and the driver, which some environments cannot provide. Not recommended for new development.
SQL Server Native Client 11.0 (SQLNCLI11)A newer generation than SQLNCLI10, but also not recommended for new development. Whether TLS 1.2 is usable depends on the updates applied (verify before relying on this).
Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)The current-generation OLE DB driver. The 18.x series and earlier defaulted the connection string to `Encrypt=no`.
Microsoft OLE DB Driver 19 (MSOLEDBSQL19)The default changed to `Encrypt=yes`. In environments where the certificate is not trusted, an existing connection string will not work as-is.
Amazon RDS for SQL ServerThe certificate on the RDS side is managed by the service. Check the target environment's procedure for deploying the CA to the client-side trust store and specifying the hostname (verify before relying on this).

これで解決しない場合に確認すること

  • The client OS's patch level

    Sometimes not just the driver but the OS's TLS implementation also needs an update.

  • The application framework's protocol settings

    Check whether the protocol is fixed in something like .NET. Updating the driver alone does not always resolve this.

  • Devices along the network path

    If TLS is terminated at a load balancer or proxy, its protocol settings are also worth checking.

  • Connection errors in the SQL Server error log

    Check whether the server-side log recorded anything at the time of a connection failure, to see whether the disconnect happened before reaching the client.

この文書の根拠と限界

製品の公式ドキュメントに基づく説明

Based on public information about SQL Server client driver generations (SQL Server Native Client and the Microsoft OLE DB Driver for SQL Server), and the specifications of `sys.dm_exec_connections` / `SERVERPROPERTY`. KB numbers and applicable builds for TLS 1.2 support vary by product and OS, and since reliable information cannot be given in general, they are deliberately omitted here. Cross-reference your target environment's build number against the vendor's support information.

よくある質問

What's the difference between SQLNCLI10 and MSOLEDBSQL19?

SQLNCLI10 is the SQL Server Native Client from the SQL Server 2008 generation and is not recommended for new development. MSOLEDBSQL19 is the 19.x series of the current Microsoft OLE DB Driver for SQL Server, whose default has changed to `Encrypt=yes`. When migrating, always check the difference in default behavior for encryption and certificate validation.

Why did connections break after I swapped the driver to 19?

Because MSOLEDBSQL 19 changed the connection-string default to `Encrypt=yes`. In an environment where the server certificate is not trusted, this fails on certificate validation even without changing the connection string. The permanent fix is deploying a trusted certificate; `TrustServerCertificate=yes` is a stopgap.

Is it safe to set TrustServerCertificate=yes?

The traffic itself is still encrypted, but validation that you are connecting to a legitimate server is skipped. This weakens protection against man-in-the-middle attacks, so it should not be left as a permanent setting. Use it with a deadline, for isolating the cause and temporary recovery.

Can this be run in production?

Checking the server version, listing connected clients, and checking client-side drivers/registry are all read-only and can be run in production. Changing the connection string, swapping drivers, and changing TLS settings all have a broad scope of impact and assume verification in a test environment plus a change management process.

What permissions are required?

Checking the server version requires connection permission; getting the connection list requires VIEW SERVER STATE. Checking client-side drivers and the registry may require administrator privileges.

How should I interpret the results?

If it connects with `Encrypt=no` but fails with `Encrypt=yes;TrustServerCertificate=no`, it's a certificate issue; if both fail, it's a TLS version or driver issue. Narrow it to one of these two first, then decide between applying an update or fixing the certificate.

この文書がカバーする質問

  • Cannot connect from SQL Server 2008 to AWS RDS
  • Difference between SQLNCLI10 and MSOLEDBSQL19
  • Cannot connect with TLS 1.2
  • Getting a certificate error after updating the driver

リスク表示の意味

  • 参照のみデータと設定を変更しません。
  • 影響は限定的ですが、権限と負荷の確認が必要です。
  • 性能・ロック・コストに影響する可能性があります。
  • 障害・データ損失・復旧作業が発生する可能性があります。
  • 専門家レビュー必須本番適用前に別途レビューが必須です。

GIIPの対応範囲

A driver generation change typically surfaces as "something that had been working stops the moment a server setting changes." At GIIP, we periodically tally connected client libraries so we can list, at a glance, which systems still have connections coming in from an old-generation driver. Because changing TLS settings or swapping drivers has a broad scope of impact, these are excluded from automatic application — we handle identifying affected applications and organizing the migration order instead.

執筆・技術検証

GIIP プロダクション運用チーム

大規模Webサービス、SQL Server、Oracle、AWS、Azureの設計・移行・運用に約30年従事。x12largeクラスのAWS RDS for SQL Server環境12セット、約12万テーブルのOracle環境、約3TBのTiDBからAurora MySQLへの移行を経験。現在も複数のクラウドデータベースと約30のWebサービスを、AIエージェントと人間の専門家が継続的に監視・運用しています。

関連するナレッジ

関連サービス

Get advice on a legacy connection driver migration plan

同じ確認を複数の環境で継続する必要がある場合は、運用体制ごと相談できます。

Get advice on a legacy connection driver migration plan

ナレッジベース一覧へ