.NET framework 2.0 版 Service Pack 2 (SP2) 和較早版本硬式編碼的安全通訊端層 (SSL) v3.0 和傳輸層安全性 (TLS) v1.0,藉由使用預設除非由.NET 應用程式指定不同的通訊協定版本。 .NET Framework 2.0 sp2,Windows Vista SP2 和 Windows Server 2008 SP2 這個更新會新增使用 SSL 及 TLS 預設值由作業系統所提供的選項。
附註 此內容已設為可以在 Windows 更新。 若要取得內容,請掃描 Windows 更新最新的.NET Framework 的更新。 如果您的系統是部署最透過 Windows Update,則您不需要採取進一步的動作。
解決方案
下載資訊
下列檔案是可以從 「 Microsoft 下載中心 」 下載:立即下載以 x86 為基礎的套件。
立即下載 x64 為主的套件。
立即下載以 IA64 為基礎的套件。我們已經在這個區域中下列改進:
-
對於電腦上執行的受管理應用程式,您可以將下列登錄機碼設定為使用 SSL 和 TLS 的作業系統預設值,而非硬式編碼的 .NET Framework 預設值。
-
若為 64 位元的作業系統:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]"SystemDefaultTlsVersions"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727]"SystemDefaultTlsVersions"=dword:00000001
-
若為 32 位元的作業系統:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]"SystemDefaultTlsVersions"=dword:00000001
注意如果應用程式在程式碼或組態檔,為特定的值,透過已設定為ServicePointManager.SecureProtocol或SslStream.AuthenticateAs* Api 會使用來指定特定的SslProtocols列舉的登錄設定不會發生問題。
-
-
此外,我們新增了您可以使用的選項,以.NET 為目標時,設定 [TLS v1.2、 TLS v1.1,以及作業系統的預設值為ServicePointManager.SecurityProtocol屬性的SslProtocolsExtensions列舉型別架構版本 2.0 SP2。 (有關如何使用擴充功能,請參閱開發人員指南一節中的資訊)。注意Windows Vista SP2 及 Windows Server 2008 SP2 不支援傳輸層安全性 (TLS) 通訊協定版本比 1.0 還新。 在 Windows Vista SP2 或 Windows Server 2008 SP2 上執行的 managed 的.NET Framework 2.0 SP2 應用程式不能使用 TLS 1.2 或 TLS 1.1 中,即使這些通訊協定設定ServicePointManager.SecurityProtocol屬性中。
如需有關如何下載 Microsoft 支援檔案的詳細資訊,請按一下下面的文件編號,檢視「Microsoft 知識庫」中的文件:
119591 如何從線上服務取得 Microsoft 支援檔案 Microsoft 已對此檔案進行病毒掃描。 Microsoft 是利用發佈當日的最新病毒偵測軟體來掃描檔案。 檔案會儲存在安全性強化的伺服器上,以避免任何未經授權的變更。
開發人員指南
新的擴充功能的定義位於下列檔案:
-
SecurityProtocolTypeExtensions.csnamespace System.Net{using System.Security.Authentication;public static class SecurityProtocolTypeExtensions{public const SecurityProtocolType Tls12 = (SecurityProtocolType)SslProtocolsExtensions.Tls12;public const SecurityProtocolType Tls11 = (SecurityProtocolType)SslProtocolsExtensions.Tls11;public const SecurityProtocolType SystemDefault = (SecurityProtocolType)0;}}
-
SslProtocolsExtensions.csnamespace System.Security.Authentication{public static class SslProtocolsExtensions{public const SslProtocols Tls12 = (SslProtocols)0x00000C00;public const SslProtocols Tls11 = (SslProtocols)0x00000300;}}
若要包含的 TLS v1.2 支援,包含原始程式檔在專案中,並使用下列方法,以設定的通訊協定版本:
-
使用 ServicePointManager 為基礎的 Api 的應用程式可以使用 following:System.Net.ServicePointManager.SecurityProtocol,設定通訊協定 = SecurityProtocolTypeExtensions.Tls12;
-
使用SslStream AuthenticateAsClient (字串,X509CertificateCollection,SslProtocols,布林值)多載的應用程式可以設定成SslProtocolsExtensions.的SslProtocols值Tls12.
如果設定的第一段所述的登錄設定,而且SslProtocols值設為SslProtocols.None應用程式中,系統預設行為選擇,取決於 Windows 版本。此外,當您變更應用程式程式碼,來啟用.NET Framework 3.5 sp1 的 TLS v1.2 支援時,您應該要確定您解決下列的例外狀況,在沒有部署此更新程式所在的電腦上項目:
-
如果未安裝 hotfix, ServicePointManager-根據的 Api (HTTP 或 FTP,SMTP) 將會擲回 「System.NotSupportedException: 不支援要求的安全性通訊協定"當應用程式會呼叫ServicePointManager.SecurityProtocol若要設定新的值。
-
如果未安裝 hotfix, SslStream為基礎的 Api 會擲回例外狀況,當它們呼叫 AuthenticateAs * Api 其中一種方法:
System.ArgumentException: 指定的值是無效的 'SslProtocolType' 的列舉型別中。參數名稱: sslProtocolType
注意為SslStream , Tls12, Tls11與任何現有的Tls, Ssl3, Ssl2的組合 (例如: Tls12 |Tls11 |Tls) 會以無訊息模式會降級為現有的通訊協定 (例如: Tls) 沒有此補充程式的系統上。 要連線到 Tls 而不擲回例外狀況。
其他相關資訊
若要啟用 TLS v1.1 或 v1.2,做為作業系統的預設值,請依照下列的指示,在https://technet.microsoft.com/en-us/library/dn786418(v=ws.11).aspx#BKMK_SchannelTR_TLS12.注意: TLS v1.1 和 v1.2 並非適用於 Windows Vista 或 Windows 伺服器的 2008.If,您必須停用作業系統預設值由是 < 解決方案=""> 一節所述特定的應用程式,您可以藉由新增的登錄機碼設定下列的登錄機碼:HKEY_LOCAL_MACHINE\SOFTWARE\[Wow6432Node\]Microsoft\.NETFramework\v2.0.50727\System.Net.ServicePointManager.SystemDefaultTlsVersions<<Full path of the .exe for the file>> DWORD 0C:\MyApp\MyApp.exe DWORD 0
如需 TLS v1.2 的詳細資訊,請參閱引入 TLS v1.2。啟用SystemDefaultTlsVersions .NET 的登錄機碼之後下, 表所示,每個版本的 Windows 上時就會發生不同的行為。
Windows 版本 |
SSL2 用戶端 |
SSL2 伺服器 |
SSL3 用戶端 |
SSL3 伺服器 |
TLS 1.0 用戶端 |
TLS 1.0 伺服器 |
TLS 1.1 用戶端 |
TLS 1.1 伺服器 |
TLS 1.2 用戶端 |
TLS 1.2 伺服器 |
---|---|---|---|---|---|---|---|---|---|---|
Windows Vista SP2 及 Windows Server 2008 SP2 |
關閉 |
在上 |
在上 |
在上 |
在上 |
在上 |
N/A |
N/A |
N/A |
N/A |
Windows 7 SP1 和 Windows Server 2008 R2 SP1 |
關閉 |
在上 |
在上 |
在上 |
在上 |
在上 |
關閉 |
關閉 |
關閉 |
關閉 |
Windows Server 2012 |
關閉 |
關閉 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
Windows 8.1 和 Windows Server 2012 R2 |
關閉 |
關閉 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
Windows 10 |
關閉 |
關閉 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
Windows 10 (1511) |
關閉 |
關閉 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |
Windows 10 (1607) 和 Windows Server 2016 |
N/A |
N/A |
關閉 |
關閉 |
在上 |
在上 |
在上 |
在上 |
在上 |
在上 |