TLS extensions support with ALB

TLS extensions support with ALB

  • Supported: ALPN, NPN, Session Ticket, TLS False Start

  • Unsuppored: TLS Renegotiation, OCSP Stapling

ALPN, NPN 対応

デフォルトだとALPNによるネゴシエーションが行われる。ここでは、クライアントからh2とhttp/1.1でリクエストが行われて、ネゴシエーションが行われるが、ALBはALPNでh2のみのサポートなので、結果的にHTTP/2でリクエストが行われている。

$ curl -Iv --http2 https://alb.test.hayashier.com
* Rebuilt URL to: https://alb.test.hayashier.com/
*   Trying 54.186.147.77...
* TCP_NODELAY set
* Connected to alb.test.hayashier.com (54.186.147.77) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
  CAfile: /usr/local/etc/openssl/cert.pem
  CApath: /usr/local/etc/openssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.test.hayashier.com
*  start date: Mar 28 00:00:00 2018 GMT
*  expire date: Apr 28 12:00:00 2019 GMT
*  subjectAltName: host alb.test.hayashier.com matched cert's *.test.hayashier.com
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fbe72001a00)
> HEAD / HTTP/2
> Host: alb.test.hayashier.com
> User-Agent: curl/7.59.0
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200 
HTTP/2 200 
< date: Tue, 24 Jul 2018 00:03:54 GMT
date: Tue, 24 Jul 2018 00:03:54 GMT
< content-type: text/html; charset=UTF-8
content-type: text/html; charset=UTF-8
< content-length: 47
content-length: 47
< server: Apache/2.2.34 (Amazon)
server: Apache/2.2.34 (Amazon)
< last-modified: Sat, 27 Jan 2018 17:13:02 GMT
last-modified: Sat, 27 Jan 2018 17:13:02 GMT
< etag: 60725-2f-563c5202222f8
etag: 60725-2f-563c5202222f8
< accept-ranges: bytes
accept-ranges: bytes

< 
* Connection #0 to host alb.test.hayashier.com left intact

ALPNを利用しない場合、NPNによるネゴシエーションが行われて、ALB側から提示されたHTTP/2でリクエストが行われる。

ALPNもNPNも無効化するとHTTP/1.1によるリクエストが行われる。

Session Ticket対応, OCSPステープリング未対応, TLSリネゴシエーション未対応

Secure Renegotiation IS supportedと表示されているのは、TLSリネゴシエーションが全く対応していないことを誤解なく表現することができないため。 TLS ネゴシエーションの対応状況の表示について、Secure Renegotiation IS NOT supportedという表記もあるが、古いバージョンやセキュアではないものなら対応しているとクライアント側が捉えてしまう。

TLS False Start 対応

curlコマンド実行時の内容をtcpdumpで取得。

sslkey.logの内容は以下。

  • Wiresharkを起動して、Wireshark > Preferences > Protocols > SSL から (Pre)-Master-Secret log filenameで先程のsslkey.logを選択して、TLSのデコード。

  • クライアントは、サーバからのFinishedメッセージを受け取る前にApplication Dataが送られている。

No.13のAlertプロトコルはClose Notifyのもの

Reference

  • Transport Layer Security (TLS)

    • URL: https://hpbn.co/transport-layer-security-tls/

Last updated