Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 253. TLS 1.2를 적용한 IIS 웹 사이트 구성 [링크 복사], [링크+제목 복사],
조회: 42828
글쓴 사람
정성태 (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)
12680정성태6/18/20218284오류 유형: 726. python2.7.exe 실행 시 0xc000007b 오류
12679정성태6/18/20218896COM 개체 관련: 23. CoInitializeSecurity의 전역 설정을 재정의하는 CoSetProxyBlanket 함수 사용법파일 다운로드1
12678정성태6/17/20218127.NET Framework: 1072. C# - CoCreateInstance 관련 Inteop 오류 정리파일 다운로드1
12677정성태6/17/20219633VC++: 144. 역공학을 통한 lxssmanager.dll의 ILxssSession 사용법 분석파일 다운로드1
12676정성태6/16/20219687VC++: 143. ionescu007/lxss github repo에 공개된 lxssmanager.dll의 CLSID_LxssUserSession/IID_ILxssSession 사용법파일 다운로드1
12675정성태6/16/20217680Java: 20. maven package 명령어 결과물로 (war가 아닌) jar 생성 방법
12674정성태6/15/20218450VC++: 142. DEFINE_GUID 사용법
12673정성태6/15/20219613Java: 19. IntelliJ - 자바(Java)로 만드는 Web App을 Tomcat에서 실행하는 방법
12672정성태6/15/202110778오류 유형: 725. IntelliJ에서 Java webapp 실행 시 "Address localhost:1099 is already in use" 오류
12671정성태6/15/202117472오류 유형: 724. Tomcat 실행 시 Failed to initialize connector [Connector[HTTP/1.1-8080]] 오류
12670정성태6/13/20219024.NET Framework: 1071. DLL Surrogate를 이용한 Out-of-process COM 개체에서의 CoInitializeSecurity 문제파일 다운로드1
12669정성태6/11/20218997.NET Framework: 1070. 사용자 정의 GetHashCode 메서드 구현은 C# 9.0의 record 또는 리팩터링에 맡기세요.
12668정성태6/11/202110775.NET Framework: 1069. C# - DLL Surrogate를 이용한 Out-of-process COM 개체 제작파일 다운로드2
12667정성태6/10/20219410.NET Framework: 1068. COM+ 서버 응용 프로그램을 이용해 CoInitializeSecurity 제약 해결파일 다운로드1
12666정성태6/10/20217990.NET Framework: 1067. 별도 DLL에 포함된 타입을 STAThread Main 메서드에서 사용하는 경우 CoInitializeSecurity 자동 호출파일 다운로드1
12665정성태6/9/20219295.NET Framework: 1066. Wslhub.Sdk 사용으로 알아보는 CoInitializeSecurity 사용 제약파일 다운로드1
12664정성태6/9/20217573오류 유형: 723. COM+ PIA 참조 시 "This operation failed because the QueryInterface call on the COM component" 오류
12663정성태6/9/20219093.NET Framework: 1065. Windows Forms - 속성 창의 디자인 설정 지원: 문자열 목록 내에서 항목을 선택하는 TypeConverter 제작파일 다운로드1
12662정성태6/8/20218241.NET Framework: 1064. C# COM 개체를 PIA(Primary Interop Assembly)로써 "Embed Interop Types" 참조하는 방법파일 다운로드1
12661정성태6/4/202118873.NET Framework: 1063. C# - MQTT를 이용한 클라이언트/서버(Broker) 통신 예제 [4]파일 다운로드1
12660정성태6/3/20219983.NET Framework: 1062. Windows Forms - 폼 내에서 발생하는 마우스 이벤트를 자식 컨트롤 영역에 상관없이 수신하는 방법 [1]파일 다운로드1
12659정성태6/2/202111252Linux: 40. 우분투 설치 후 MBR 디스크 드라이브 여유 공간이 인식되지 않은 경우 - Logical Volume Management
12658정성태6/2/20218665Windows: 194. Microsoft Store에 있는 구글의 공식 Youtube App
12657정성태6/2/20219980Windows: 193. 윈도우 패키지 관리자 - winget 설치
12656정성태6/1/20218178.NET Framework: 1061. 서버 유형의 COM+에 적용할 수 없는 Server GC
12655정성태6/1/20217720오류 유형: 722. windbg/sos - savemodule - Fail to read memory
... 31  32  33  34  35  36  37  [38]  39  40  41  42  43  44  45  ...