Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 253. TLS 1.2를 적용한 IIS 웹 사이트 구성 [링크 복사], [링크+제목 복사]
조회: 42781
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 3개 있습니다.)

TLS 1.2를 적용한 IIS 웹 사이트 구성

역시 이 글도 아래의 질문 덕분에 쓰여진 것입니다. ^^

windows 2008 r2에서 ms-sql 2008 서버사용시 tls문제점
; https://www.sysnet.pe.kr/3/0/1523

제목에서 밝혔듯이, 이번 글에서는 IIS 웹 사이트에 TLS 1.2 적용을 위한 방법을 알아보겠습니다. 그런데, 글을 쓸 필요도 없이 이렇게 검색되는군요. ^^

Enable TLS 1.1 and TLS 1.2 on Windows Server 2008 R2 and IIS 7.5
; http://www.adminhorror.com/2011/10/enable-tls-11-and-tls-12-on-windows_1853.html

그래서, IIS 웹 사이트에 인증서 바인딩시키고 "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols" 키에 다음과 같이 TLS 1.2만을 활성화하고 나머지 TLS 1.0/1.1은 비활성화 시켰습니다.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client]
"DisabledByDefault"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client]
"DisabledByDefault"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
"Enabled"=dword:00000001
"DisabledByDefault"=dword:00000000

일반적으로는 이 설정이 EXE 프로세스를 재시작하는 것만으로 반영되지만, IIS의 경우는 System 프로세스에 커널 드라이버로 서비스되고 있기 때문에 이를 반영하려면 컴퓨터를 재부팅해야 합니다.

그 후로는, TLS 1.0/TLS 1.1 프로토콜로 접속하려 하면 다음과 같이 오류 화면이 뜨게 됩니다.

tls12_support_1.png

This page can’t be displayed

Turn on TLS 1.0, TLS 1.1, and TLS 1.2 in Advanced settings and try connecting to https://... again. If this error persists, contact your site administrator.


물론, "Use TLS 1.2" 옵션을 켜면 웹 브라우저에서 접속이 됩니다. 이 때의 네트워크 패킷을 "Microsoft Network Monitor"를 이용해 "tcp.port == 443" 필터로 놓고 웹 브라우저가 서버로 전송하는 handshake 패킷과,

  Frame: Number = 27930, Captured Frame Length = 232, MediaType = ETHERNET
+ Ethernet: Etype = Internet IP (IPv4),DestinationAddress:[00-15-5D-00-05-04],SourceAddress:[00-26-66-4D-F5-15]
+ Ipv4: Src = 192.168.0.5, Dest = 192.168.0.23, Next Protocol = TCP, Packet ID = 6958, Total IP Length = 218
+ Tcp: Flags=...AP..., SrcPort=56832, DstPort=HTTPS(443), PayloadLen=178, Seq=1561831547 - 1561831725, Ack=497462568, Win=1024 (scale factor 0x8) = 262144
  TLSSSLData: Transport Layer Security (TLS) Payload Data
- TLS: TLS Rec Layer-1 HandShake: Client Hello.
  - TlsRecordLayer: TLS Rec Layer-1 HandShake:
     ContentType: HandShake:
   - Version: TLS 1.2
      Major: 3 (0x3)
      Minor: 3 (0x3)
     Length: 173 (0xAD)
   - SSLHandshake: SSL HandShake ClientHello(0x01)
      HandShakeType: ClientHello(0x01)
      Length: 169 (0xA9)
    - ClientHello: TLS 1.2
     + Version: TLS 1.2
	 ...[생략]...
     + ClientHelloExtension: SessionTicket TLS(0x0023)

그에 대한 응답을 통해 TLS 1.2 프로토콜이 사용된 것임을 알 수 있습니다.

  Frame: Number = 27931, Captured Frame Length = 1527, MediaType = ETHERNET
+ Ethernet: Etype = Internet IP (IPv4),DestinationAddress:[00-26-66-4D-F5-15],SourceAddress:[00-15-5D-00-05-04]
+ Ipv4: Src = 192.168.0.23, Dest = 192.168.0.5, Next Protocol = TCP, Packet ID = 21794, Total IP Length = 0
+ Tcp: Flags=...AP..., SrcPort=HTTPS(443), DstPort=56832, PayloadLen=1473, Seq=497462568 - 497464041, Ack=1561831725, Win=513 (scale factor 0x8) = 131328
  TLSSSLData: Transport Layer Security (TLS) Payload Data
- TLS: TLS Rec Layer-1 HandShake: Server Hello. Certificate. Server Hello Done.
  - TlsRecordLayer: TLS Rec Layer-1 HandShake:
     ContentType: HandShake:
   - Version: TLS 1.2
      Major: 3 (0x3)
      Minor: 3 (0x3)
     Length: 1468 (0x5BC)
   - SSLHandshake: SSL HandShake Server Hello Done(0x0E)
      HandShakeType: ServerHello(0x02)
      Length: 77 (0x4D)
    + ServerHello: 0x1
      HandShakeType: Certificate(0x0B)
      Length: 1379 (0x563)
    + Cert: 0x1
      HandShakeType: Server Hello Done(0x0E)
      Length: 0 (0x0)




재미있는 것은, 이렇게 TLS 1.2 사용을 강제하는 경우 RDP 접속도 안된다는 점입니다. 다행히 이 부분은 서버 측의 "Remote Desktop Session Host Configuration" 관리 콘솔에서 "RDP-Tcp"의 Security Layer 설정을 "RDP Security Layer"로 바꿔주는 것으로 해결할 수 있습니다. 이에 대해서는 다음의 글을 참고하세요. ^^

Remote Desktop Connection (RDP) stopped working after disabling TLS 1.0
; http://itexperiences.blogspot.kr/index.html2012/08/remote-desktop-connection-rdp-stopped.html

부가적으로 IIS 웹 사이트에 SSL 통신을 위한 인증서 관련해서 하나 더 짚고 넘어가겠습니다. 이에 대해서는 예전에 한번 설명한 적이 있습니다.

IIS 7 관리자 - Active Directory Certification Authority 로부터 SSL 사이트 인증서 받는 방법
; https://www.sysnet.pe.kr/2/0/1025

그런데, 아쉽게도 현재 Active Directory의 CA 서버로부터 자동으로 받게 되는 인증서는 기본적으로 1024비트로 되어 있습니다. 현재 최소 2048비트 이상의 키 길이를 가지도록 하는 것이 권장 사항이므로 이를 위해서는 부가적인 작업이 필요합니다. 그래도 이미 다른 글에서 모두 친절하게 잘 설명하고 있습니다. ^^

Creating 2048 bit Domain SSL Certificate 
; http://support.thycotic.com/kb/a247/creating-2048-bit-domain-ssl-certificate.aspx

저도 예전에 ^^ 인증서 템플릿을 수정하는 방법을 설명했었습니다.

CA 서비스 - 사용자 정의 템플릿 유형 추가
; https://www.sysnet.pe.kr/2/0/533

가볍게 정리해 보면!

CA 서비스가 설치된 컴퓨터에 접속해 "Certificate Authority" 관리 콘솔을 띄우고 "Certificate Templates" 노드에 마우스 우클릭을 해 "Manage" 메뉴를 선택합니다. 그럼, "Certificate Templates Console"이 뜨고, 거기에서 "Template Display Name"이 "Web Server"인 것을 선택해 속성 메뉴를 누르면 "Properties of New Template"창이 뜹니다. 거기에서 다음과 같은 설정의 인증서 템플릿을 만듭니다.

"General" 탭
 - "Template display name"에 적당한 이름(예: Web Server 2048 bit) 설정
 - "Publish certificate in Active Directory" 설정
 
"Request Handling" 탭
 - "Allow private key to be exported"를 선택

"Cryptography" 탭
 - "Minimum key size"를 2048로 설정(R2의 경우 기본값이 2048이므로 별도 설정 필요없음.)

"Security" 탭
 - "Authenticated Users" 계정의 "Enroll" 권한을 "Allow"

(참고로, 이 템플릿은 기본적으로 CA 서비스의 "Certificate Template"에 보이지 않으므로 "Certificate Template to Issue" 메뉴를 통해 추가해 주면 인증서 웹 요청 화면에서도 볼 수 있습니다.)

자, 이제 다시 IIS 관리자의 "Server Certificates"에서 1024비트로 받은 기존 인증서가 있다면 "Renew..." 하시고, 아니면 새롭게 도메인 인증서를 선택해 주시면 됩니다. (Renew한 경우, 당연히 Thumbprint 값이 바뀌므로 혹시 기존 서비스에서 hash 값을 등록한 것이 있다면 바꿔주어야 합니다.)

그럼, 다음과 같이 2048비트 길이의 인증서가 준비됩니다. ^^

tls12_support_2.png




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 1/23/2015]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13481정성태12/13/20232279개발 환경 구성: 693. msbuild - .NET Core/5+ 프로젝트에서 resgen을 이용한 리소스 파일 생성 방법파일 다운로드1
13480정성태12/12/20232644개발 환경 구성: 692. Windows WSL 2 + Chrome 웹 브라우저 설치
13479정성태12/11/20232332개발 환경 구성: 691. WSL 2 (Ubuntu) + nginx 환경 설정
13477정성태12/8/20232523닷넷: 2182. C# - .NET 7부터 추가된 Int128, UInt128 [1]파일 다운로드1
13476정성태12/8/20232257닷넷: 2181. C# - .NET 8 JsonStringEnumConverter의 AOT를 위한 개선파일 다운로드1
13475정성태12/7/20232319닷넷: 2180. .NET 8 - 함수 포인터에 대한 Reflection 정보 조회파일 다운로드1
13474정성태12/6/20232169개발 환경 구성: 690. 닷넷 코어/5+ 버전의 ilasm/ildasm 실행 파일 구하는 방법 - 두 번째 이야기
13473정성태12/5/20232373닷넷: 2179. C# - 값 형식(Blittable)을 메모리 복사를 이용해 바이트 배열로 직렬화/역직렬화파일 다운로드1
13472정성태12/4/20232189C/C++: 164. Visual C++ - InterlockedCompareExchange128 사용 방법
13471정성태12/4/20232266Copilot - To enable GitHub Copilot, authorize this extension using GitHub's device flow
13470정성태12/2/20232558닷넷: 2178. C# - .NET 8부터 COM Interop에 대한 자동 소스 코드 생성 도입파일 다운로드1
13469정성태12/1/20232277닷넷: 2177. C# - (Interop DLL 없이) CoClass를 이용한 COM 개체 생성 방법파일 다운로드1
13468정성태12/1/20232219닷넷: 2176. C# - .NET Core/5+부터 달라진 RCW(Runtime Callable Wrapper) 대응 방식파일 다운로드1
13467정성태11/30/20232303오류 유형: 882. C# - Unhandled exception. System.Runtime.InteropServices.COMException (0x800080A5)파일 다운로드1
13466정성태11/29/20232486닷넷: 2175. C# - DllImport 메서드의 AOT 지원을 위한 LibraryImport 옵션
13465정성태11/28/20232239개발 환경 구성: 689. MSBuild - CopyToOutputDirectory가 "dotnet publish" 시에는 적용되지 않는 문제파일 다운로드1
13464정성태11/28/20232370닷넷: 2174. C# - .NET 7부터 UnmanagedCallersOnly 함수 export 기능을 AOT 빌드에 통합파일 다운로드1
13463정성태11/27/20232301오류 유형: 881. Visual Studio - NU1605: Warning As Error: Detected package downgrade
13462정성태11/27/20232340오류 유형: 880. Visual Studio - error CS0246: The type or namespace name '...' could not be found
13461정성태11/26/20232372닷넷: 2173. .NET Core 3/5+ 기반의 COM Server를 registry 등록 없이 사용하는 방법파일 다운로드1
13460정성태11/26/20232324닷넷: 2172. .NET 6+ 기반의 COM Server 내에 Type Library를 내장하는 방법파일 다운로드1
13459정성태11/26/20232295닷넷: 2171. .NET Core 3/5+ 기반의 COM Server를 기존의 regasm처럼 등록하는 방법파일 다운로드1
13458정성태11/26/20232305닷넷: 2170. .NET Core/5+ 기반의 COM Server를 tlb 파일을 생성하는 방법(tlbexp)
13457정성태11/25/20232252VS.NET IDE: 187. Visual Studio - 16.9 버전부터 추가된 "Display inline type hints" 옵션
13456정성태11/25/20232550닷넷: 2169. C# - OpenAI를 사용해 PDF 데이터를 대상으로 OpenAI 챗봇 작성 [1]파일 다운로드1
13455정성태11/25/20232452닷넷: 2168. C# - Azure.AI.OpenAI 패키지로 OpenAI 사용파일 다운로드1
1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...