Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 253. TLS 1.2를 적용한 IIS 웹 사이트 구성 [링크 복사], [링크+제목 복사],
조회: 42846
글쓴 사람
정성태 (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

비밀번호

댓글 작성자
 




... 31  32  33  34  35  36  37  38  39  40  41  42  43  [44]  45  ...
NoWriterDateCnt.TitleFile(s)
12530정성태2/4/202113060개발 환경 구성: 536. Wireshark + C#으로 확인하는 TCP 통신의 Receive Window
12529정성태2/4/202110143개발 환경 구성: 535. Wireshark + C#으로 확인하는 TCP 통신의 MIN RTO [1]
12528정성태2/1/20219551개발 환경 구성: 534. Wireshark + C#으로 확인하는 TCP 통신의 MSS(Maximum Segment Size) - 윈도우 환경
12527정성태2/1/20219768개발 환경 구성: 533. Wireshark + C#으로 확인하는 TCP 통신의 MSS(Maximum Segment Size) - 리눅스 환경파일 다운로드1
12526정성태2/1/20217627개발 환경 구성: 532. Azure Devops의 파이프라인 빌드 시 snk 파일 다루는 방법 - Secure file
12525정성태2/1/20217320개발 환경 구성: 531. Azure Devops - 파이프라인 실행 시 빌드 이벤트를 생략하는 방법
12524정성태1/31/20218394개발 환경 구성: 530. 기존 github 프로젝트를 Azure Devops의 빌드 Pipeline에 연결하는 방법 [1]
12523정성태1/31/20218420개발 환경 구성: 529. 기존 github 프로젝트를 Azure Devops의 Board에 연결하는 방법
12522정성태1/31/20219906개발 환경 구성: 528. 오라클 클라우드의 리눅스 VM - 9000 MTU Jumbo Frame 테스트
12521정성태1/31/20219921개발 환경 구성: 527. 이더넷(Ethernet) 환경의 TCP 통신에서 MSS(Maximum Segment Size) 확인 [1]
12520정성태1/30/20218424개발 환경 구성: 526. 오라클 클라우드의 VM에 ping ICMP 여는 방법
12519정성태1/30/20217522개발 환경 구성: 525. 오라클 클라우드의 VM을 외부에서 접근하기 위해 포트 여는 방법
12518정성태1/30/202124952Linux: 37. Ubuntu에 Wireshark 설치 [2]
12517정성태1/30/202112558Linux: 36. 윈도우 클라이언트에서 X2Go를 이용한 원격 리눅스의 GUI 접속 - 우분투 20.04
12516정성태1/29/20219214Windows: 188. Windows - TCP default template 설정 방법
12515정성태1/28/202110428웹: 41. Microsoft Edge - localhost에 대해 http 접근 시 무조건 https로 바뀌는 문제 [3]
12514정성태1/28/202110728.NET Framework: 1021. C# - 일렉트론 닷넷(Electron.NET) 소개 [1]파일 다운로드1
12513정성태1/28/20218739오류 유형: 698. electronize - User Profile 디렉터리에 공백 문자가 있는 경우 빌드가 실패하는 문제 [1]
12512정성태1/28/20218523오류 유형: 697. The program can't start because VCRUNTIME140.dll is missing from your computer. Try reinstalling the program to fix this problem.
12511정성태1/27/20218261Windows: 187. Windows - 도스 시절의 8.3 경로를 알아내는 방법
12510정성태1/27/20218665.NET Framework: 1020. .NET Core Kestrel 호스팅 - Razor 지원 추가 [1]파일 다운로드1
12509정성태1/27/20219610개발 환경 구성: 524. Jupyter Notebook에서 C#(F#, PowerShell) 언어 사용을 위한 환경 구성 [3]
12508정성태1/27/20218207개발 환경 구성: 523. Jupyter Notebook - Slide 플레이 버튼이 없는 경우
12507정성태1/26/20218331VS.NET IDE: 157. Visual Studio - Syntax Visualizer 메뉴가 없는 경우
12506정성태1/25/202111602.NET Framework: 1019. Microsoft.Tye 기본 사용법 소개 [1]
12505정성태1/23/20219376.NET Framework: 1018. .NET Core Kestrel 호스팅 - Web API 추가 [1]파일 다운로드1
... 31  32  33  34  35  36  37  38  39  40  41  42  43  [44]  45  ...