development

TLS 1.2의 .NET 구현이 있습니까?

big-blog 2020. 10. 18. 18:46
반응형

TLS 1.2의 .NET 구현이 있습니까?


방금 RFC 5425를 사용하려면 TLS 1.2를 사용해야하고 .NET이 아직이를 지원하지 않는다는 사실을 알게 되었기 때문에 RFC 5246에 정의 된대로 TLS 1.2 프로토콜의 구현 (오픈 소스)이 있는지 궁금합니다.


.Net Framework 4.5는 이제 TLSv1.2를 지원합니다.
http://msdn.microsoft.com/en-us/library/system.security.authentication.sslprotocols(v=vs.110).aspx


예, System.Net.ServicePointManager.SecurityProtocol 에서 TLS 1.2를 수동으로 켜야합니다.

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; // comparable to modern browsers
var response = WebRequest.Create("https://www.howsmyssl.com/").GetResponse();
var body = new StreamReader(response.GetResponseStream()).ReadToEnd();

클라이언트가 가장 최신 버전의 암호화 프로토콜 인 TLS 1.2를 사용하고 있습니다.


박스 아웃, WebRequest 클래스는 TLS 1.0 또는 SSL (3)를 사용합니다 .

클라이언트가 TLS 1.0을 사용하고 있습니다. TLS 1.0은 매우 오래되어 BEAST 공격에 취약 할 수 있으며 사용할 수있는 최상의 암호 제품군이 없습니다. MD5-SHA-1을 대체하기위한 AES-GCM 및 SHA256과 같은 추가 기능은 TLS 1.0 클라이언트와 더 많은 최신 암호 제품군에서 사용할 수 없습니다.


SchUseStrongCrypto 레지스트리 설정을 사용하여 모든 .NET 응용 프로그램이 기본적으로 1.0 대신 TLS 1.2를 사용하도록 요구할 수 있습니다.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

최신 .Net Framework로 전환하여 문제를 해결했습니다. 따라서 대상 프레임 워크는 보안 프로토콜을 설정합니다.

Web.config에있는 경우

<system.web>
  <httpRuntime targetFramework="4.5"/>
</system.web>

기본적으로 얻을 수 있습니다.

ServicePointManager.SecurityProtocol = Ssl3 | Tls

Web.config에있는 경우

<system.web>
  <httpRuntime targetFramework="4.6.1"/>
</system.web>

기본적으로 얻을 수 있습니다.

ServicePointManager.SecurityProtocol = Tls12 | Tls11 | Tls

.NET Framework의 이전 버전을 다루는 경우 클라이언트 및 서버 구성 요소 모두에서 SecureBlackbox 제품 에서 TLS 1.2에 대한 지원이 제공됩니다 . SecureBlackbox에는 모든 알고리즘의 자체 구현이 포함되어 있으므로 사용하는 .NET 기반 프레임 워크의 버전 (.NET CF 포함)은 중요하지 않습니다. 모든 경우에 최신 추가 기능이 포함 된 TLS 1.2를 사용할 수 있습니다.

SecureBlackbox는 프레임 워크 클래스에 TLS 1.2를 마술처럼 추가하지 않습니다. 대신 SecureBlackbox 클래스와 구성 요소를 명시 적으로 사용해야합니다.


레지스트리 키를 다운로드 하고 실행하십시오. .NET 프레임 워크 레지스트리에 필요한 키를 추가합니다. 링크 에서 더 많은 정보를 얻을 수 있습니다 . '.NET 4.5 ~ 4.5.2'에서 '옵션 2'를 검색합니다.

reg 파일은 레지스트리에 다음을 추가합니다.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

이것은 페이지가 깨졌을 때 유용한 부분입니다.

" .. enable TLS 1.2 by default without modifying the source code by setting the SchUseStrongCrypto DWORD value in the following two registry keys to 1, creating them if they don't exist: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319" and "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft.NETFramework\v4.0.30319". Although the version number in those registry keys is 4.0.30319, the .NET 4.5, 4.5.1, and 4.5.2 frameworks also use these values. Those registry keys, however, will enable TLS 1.2 by default in all installed .NET 4.0, 4.5, 4.5.1, and 4.5.2 applications on that system. It is thus advisable to test this change before deploying it to your production servers. This is also available as a registry import file. These registry values, however, will not affect .NET applications that set the System.Net.ServicePointManager.SecurityProtocol value. "


The latest version of SSPI (bundled with Windows 7) has an implementation of TLS 1.2, which can be found in schannel.dll


.NET Framework 4.6 uses TLS 1.2 by default.

Moreover, only host application should be in .NET 4.6, referenced libraries may remain in older versions.


You can enable TLS 1.2 in IIS by following these instructions. I presume this would be sufficient if you have an ASP.NET-based application that runs on top of IIS, although it looks like it does not really meet your needs.


as mentioned here you can just add this line

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

참고URL : https://stackoverflow.com/questions/4137106/are-there-net-implementation-of-tls-1-2

반응형