Forum Discussion

Piotr_Lewandows's avatar
Piotr_Lewandows
Icon for Altostratus rankAltostratus
Nov 29, 2017

HTTP::responded based on test in SERVER_CONNECTED

Hi,

I need to gracefully respond to HTTP request when setting Server SSL profile fails. Maybe I am wrong but first event that cen be used for:

  • [PROFILE::exists serverssl] == 1 - check if profile is attached to VS
  • SSL::profile $ssls - set specific profile based on some tests

But if backend connection requires SSL but no profile is attached to VS or profile that is set via SSL::profile do not exists I would like to reject client connection by sending HTTP::response 500

Only way to cancel serverside processing I was able to figure out was setting selected pool member down via:

LB::down pool $newpool member [LB::server addr] [LB::server port]

After this command LB_FAILED is raised and I can use:

HTTP::respond 500 content "Some message" Connection close
event disable
TCP::close
return              

I am curious if this is right way to achieve my goal? Any simpler better or more robust ways?

Piotr

  • OK, what I wrote is complete crap :-(

     

    Using LB::down pool $newpool member [LB::server addr] [LB::server port] is not triggering LB_FAILED.

     

    Instead when it is used in iRule Pool Member is staying down (at least one without monitor) and only way I can figure out is using LB::up.

     

    So question remains - how to achieve my goals?

     

    Piotr