SSL Handshake Disable when no Pool Member Available iRule

はじめに:

SSLを利用しているVirtual Serverにおいて、振分け先Poolの全メンバーがダウンしている場合、BIG-IPがSSLハンドシェークを実施した上でクライアントのコネクションを拒否します

つまりサーバに接続できないにも関わらずSSLの接続が確立され、ユーザへのレスポンスに時間がかかってしまいます。(これはBIG-IPの仕様による動作です。)

ユーザへストレスを与えないためには、Poolの全メンバーがダウンしている場合に、SSLセッションを確立せずにコネクションを拒否する、あるいはSorry Serverへ転送する、などのアクションが望ましいのではないでしょうか?

今月は、SSLのVirtual Server配下のPoolがダウンの場合、SSLセッションを確立しない簡単なiRuleをご紹介します。

詳細はこちらでも確認いただけます: http://devcentral.f5.com/s/wiki/default.aspx/iRules/HowToAvoidSSLHandshakeWhenNoPoolMemberAvailable.html

メリット:
rejectでクライアントのTCPセッション拒否(RST返答)や非SSLのRedirectなどのアクションを簡単に実現し、ユーザへのレスポンスタイムを短縮する。

動作概要:
*Virutal Serverに関連付けられたPoolの全てのMemberがダウンであることを検出
*全Memberがダウンの場合にSSL::disableコマンドでSSL処理を無効化


使い方:
*HTTPSのVirtual ServerにiRuleを関連付ける

【iRule定義】 

バージョン1:TCP接続を拒否(RSTを返答)

# This event is triggered when a TCP connection is established with the client
when CLIENT_ACCEPTED {
   # Check if the default pool of the VIP has no active members
   if {[active_members [LB::server pool]] < 1}{
      # Disable the client SSL profile and send a TCP reset to the client
      SSL::disable
      reject
   }
}
バージョン2:非SSLのRedirectを実行

when CLIENT_ACCEPTED {
   # Check if the default pool of the VIP has no active members
   if {[active_members [LB::server pool]] < 1}{
      # Disable the client SSL profile and send a TCP reset to the client
      SSL::disable
set redirect_client 1
   } else {
      set redirect_client 0
}

when HTTP_REQUEST {
  if { $redirect_client } {
     HTTP::redirect "http://sorryserver.com"
  }
}

 ※F5ネットワークスジャパンでは、サンプルコードについて検証を実施していますが、お客様の使用環境における動作を保証するものではありません。実際の使用にあたっては、必ず事前にテストを実施することを推奨します。

Published Dec 08, 2008
Version 1.0

Was this article helpful?

No CommentsBe the first to comment