Piotr_Lewandows
Nov 29, 2017Altostratus
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