본문 바로가기
  • Vetheuil in Summer
Tech/TCP IP

SSL TLS ( TLS Alert Protocol )

by 눈꽃산행 2019. 3. 26.

https://en.wikipedia.org/wiki/Transport_Layer_Security#Alert_protocol

 

 

 

Alert protocol

해당 레코드는 일반적으로 핸드쉐이크 수행중 또는 애플리캐이션 교환 시에 전송하지 않습니다. 하지만 이 메시지는 핸드쉐이크가 완료된 시점부터 섹션이 닫혀지기 전사이까지에는 언제든 보내어질 수 있습니다. fatal error(치명적인 에러) 신호를 보내기 위해 이 메시지를 사용하는 경우, 해당 섹션은 즉각 종료 됩니다. 즉 이 레코드는 섹션 종류상의 목적으로 사용되어 집니다. 만약 alert 레벨이 fatal이 아닌 warning 수준으로 설정한 경우, 상대방에 의해 섹션을 종료할지 말지 선택하게 할 수 있습니다.


+ Byte +0 Byte +1 Byte +2 Byte +3
Byte
0
21  
Bytes
1..4
Version Length
(Major) (Minor) 0 2
Bytes
5..6
Level Description  
Bytes
7..(p-1)
MAC (optional)
Bytes
p..(q-1)
Padding (block ciphers only)


+

Byte +0

Byte +1

Byte +2

Byte +3

Byte
0





Bytes
1..4





Bytes
5..6





















5번째 바이트는 레벨이 들어가는 필드입니다. 레벨은 alert의 종류를 구분시켜주는 용도로 사용 됩니다. 만약 레벨이 fatal인 경우, alert메시지를 보낸 서버는 해당 섹션을 즉시 종료 시킵니다. 만약 보낸 서바가 해당 섹션을 종료시키지 않았을 경우에는 alert메시지를 받은 서버는 해당 섹션을 스스로 종료시켜야 할 것입니다. Alert records는 옵션이긴하지만 섹션 전에 Alert메시지가 빠진 경우 해당 섹션이 핸드쉐이크에 의해 다시 시작될 수도 있습니다.

일반적으로 SSL/TLS를 통해 데이터 전송을 완료한 후 섹션을 닫는 쪽 단말에서는 Alert 메시지를 보내야 합니다. Alert메시지를 보낼 때, 간단히 레벨은 warning으로 설정하고 code 값은 Close notify에 해당하는 0으로 보냅니다. 이렇게 해야지 섹션이 자동으로 재 시작되는것을 방지하여 안전하고 효과적으로 닫을 수 있습니다.


Alert 레벨 타입

코드

레벨 타입

연결 상태

1

warning

연결 또는 보안이 불안정할 수 있음.

2

fatal

연결 또는 보안이 위태로워 질 수 있거나 회복 불가한 에러가 발생할 수 있음.


아래 필드는 Alert 타입입니다:

ode Description Level types Note
0 Close notify warning/fatal
10 Unexpected message fatal
20 Bad record MAC fatal Possibly a bad SSL implementation, or payload has been tampered with e.g. FTP firewall rule on FTPS server.
21 Decryption failed fatal TLS only, reserved
22 Record overflow fatal TLS only
30 Decompression failure fatal
40 Handshake failure fatal
41 No certificate warning/fatal SSL 3.0 only, reserved
42 Bad certificate warning/fatal
43 Unsupported certificate warning/fatal e.g. certificate has only Server authentication usage enabled and is presented as a client certificate
44 Certificate revoked warning/fatal
45 Certificate expired warning/fatal Check server certificate expire also check no certificate in the chain presented has expired
46 Certificate unknown warning/fatal
47 Illegal parameter fatal
48 Unknown CA (Certificate authority) fatal TLS only
49 Access denied fatal TLS only – e.g. no client certificate has been presented (TLS: Blank certificate message or SSLv3: No Certificate alert), but server is configured to require one.
50 Decode error fatal TLS only
51 Decrypt error warning/fatal TLS only
60 Export restriction fatal TLS only, reserved
70 Protocol version fatal TLS only
71 Insufficient security fatal TLS only
80 Internal error fatal TLS only
90 User canceled fatal TLS only
100 No renegotiation warning TLS only
110 Unsupported extension warning TLS only
111 Certificate unobtainable warning TLS only
112 Unrecognized name warning/fatal TLS only; client's Server Name Indicator specified a hostname not supported by the server
113 Bad certificate status response fatal TLS only
114 Bad certificate hash value fatal TLS only
115 Unknown PSK identity (used inTLS-PSK and TLS-SRP) fatal TLS only
120 No Application Protocol fatal TLS only, client's ALPN did not contain any server-supported protocols


[출처]

http://m.cafe.daum.net/bboybeatbox/3haZ/47?listURI=%2Fbboybeatbox%2F_rec

'Tech > TCP IP' 카테고리의 다른 글

TCP DUMP  (0) 2020.03.26
SSL Handshake ( SNI 프로파일 )  (0) 2019.09.26
TCP 3 Way / 4 Way Handshake  (0) 2019.02.13
Fast Retransmit (Duplicate Acknowledgement)  (0) 2019.02.13
Retransmission TimeOut  (0) 2019.02.13