Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 253. TLS 1.2를 적용한 IIS 웹 사이트 구성 [링크 복사], [링크+제목 복사],
조회: 42845
글쓴 사람
정성태 (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)
12705정성태7/13/20218874VS.NET IDE: 168. x64 DLL 프로젝트의 컨트롤이 Visual Studio의 Designer에서 보이지 않는 문제 - 두 번째 이야기
12704정성태7/12/20218005개발 환경 구성: 576. Azure VM의 서비스를 Azure Web App Service에서만 접근하도록 NSG 설정을 제한하는 방법
12703정성태7/11/202113638개발 환경 구성: 575. Azure VM에 (ICMP) ping을 허용하는 방법
12702정성태7/11/20218801오류 유형: 733. TaskScheduler에 등록된 wacs.exe의 Let's Encrypt 인증서 업데이트 문제
12701정성태7/9/20218425.NET Framework: 1075. C# - ThreadPool의 스레드는 반환 시 ThreadStatic과 AsyncLocal 값이 초기화 될까요?파일 다운로드1
12700정성태7/8/20218841.NET Framework: 1074. RuntimeType의 메모리 누수? [1]
12699정성태7/8/20217640VS.NET IDE: 167. Visual Studio 디버깅 중 GC Heap 상태를 보여주는 "Show Diagnostic Tools" 메뉴 사용법
12698정성태7/7/202111607오류 유형: 732. Windows 11 업데이트 시 3% 또는 0%에서 다운로드가 멈춘 경우
12697정성태7/7/20217502개발 환경 구성: 574. Windows 11 (Insider Preview) 설치하는 방법
12696정성태7/6/20218057VC++: 146. 운영체제의 스레드 문맥 교환(Context Switch)을 유사하게 구현하는 방법파일 다운로드2
12695정성태7/3/20218116VC++: 145. C 언어의 setjmp/longjmp 기능을 Thread Context를 이용해 유사하게 구현하는 방법파일 다운로드1
12694정성태7/2/202110027Java: 24. Azure - Spring Boot 앱을 Java SE(Embedded Web Server)로 호스팅 시 로그 파일 남기는 방법 [1]
12693정성태6/30/20217780오류 유형: 731. Azure Web App Site Extension - Failed to install web app extension [...]. {1}
12692정성태6/30/20217681디버깅 기술: 180. Azure - Web App의 비정상 종료 시 남겨지는 로그 확인
12691정성태6/30/20218527개발 환경 구성: 573. 테스트 용도이지만 테스트에 적합하지 않은 Azure D1 공유(shared) 요금제
12690정성태6/28/20219337Java: 23. Azure - 자바(Java)로 만드는 Web App Service - Tomcat 호스팅
12689정성태6/25/20219856오류 유형: 730. Windows Forms 디자이너 - The class Form1 can be designed, but is not the first class in the file. [1]
12688정성태6/24/20219568.NET Framework: 1073. C# - JSON 역/직렬화 시 리플렉션 손실을 없애는 JsonSrcGen [2]파일 다운로드1
12687정성태6/22/20217569오류 유형: 729. Invalid data: Invalid artifact, java se app service only supports .jar artifact
12686정성태6/21/202110008Java: 22. Azure - 자바(Java)로 만드는 Web App Service - Java SE (Embedded Web Server) 호스팅
12685정성태6/21/202110221Java: 21. Azure Web App Service에 배포된 Java 프로세스의 메모리 및 힙(Heap) 덤프 뜨는 방법
12684정성태6/19/20218676오류 유형: 728. Visual Studio 2022부터 DTE.get_Properties 속성 접근 시 System.MissingMethodException 예외 발생
12683정성태6/18/202110191VS.NET IDE: 166. Visual Studio 2022 - Windows Forms 프로젝트의 x86 DLL 컨트롤이 Designer에서 오류가 발생하는 문제 [1]파일 다운로드1
12682정성태6/18/20217849VS.NET IDE: 165. Visual Studio 2022를 위한 Extension 마이그레이션
12681정성태6/18/20217210오류 유형: 727. .NET 2.0 ~ 3.5 + x64 환경에서 System.EnterpriseServices 참조 시 CS8012 경고
12680정성태6/18/20218289오류 유형: 726. python2.7.exe 실행 시 0xc000007b 오류
... 31  32  33  34  35  36  [37]  38  39  40  41  42  43  44  45  ...