vCloud HTTPS monitor broke after upgrade of backend vCloud director
I have a very simple monitor for vCloud director.
the Send String was
GET /cloud/server_status \r\n
and the receive String was
Service is up.
This was happy and fine, then we upgraded from vCloud 9.0 to 9.5 and suddenly the monitor started failing. We still have both versions running so I can do comparisons. Initially the monitor error stated that HTTP 0.9 wasn't supported on the backend server, so I modified the Send String to send that included HTTP 1.1 thinking this would sort me out.
So now my Send String looks like
GET /cloud/server_status HTTP/1.1\r\n\r\n
and Receive String looks like
Service is up. HTTP/1.1
The F5 monitor is saying its getting back a 400 bad request error but I'm really unsure why.
Doing a verbose curl I get the following response.
Legacy 9.0
< HTTP/1.1 200 OK
< Date: Mon, 25 Feb 2019 19:37:47 GMT
< X-VMWARE-VCLOUD-REQUEST-ID: 46386830-291d-45ab-89ce-c89188dc2746
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< Strict-Transport-Security: max-age=31536000 ; includeSubDomains
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Transfer-Encoding: chunked
<
Service is up.* Connection 0 to host host.name left intact
Updated 9.5 Response
HTTP/1.1 200 OK
< Date: Mon, 25 Feb 2019 19:37:02 GMT
< X-VMWARE-VCLOUD-REQUEST-ID: b1e654da-ef3d-4560-aad3-6690509ce219
< Strict-Transport-Security: max-age=31536000 ; includeSubDomains
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Content-Security-Policy: default-src * data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';
< Vary: Accept-Encoding, User-Agent
< Transfer-Encoding: chunked
<
Service is up.* Connection 0 to host host.name left intact
So I'm really confused as to what it is about the new response thats breaking the monitor. Any suggestions are appreciated.
Try adding a Host: header to your send string. I believe HTTP/1.1 requires it even if it is empty.
Something like
GET /cloud/server_status HTTP/1.1\r\nHost:\r\n\r\n
Hope that helps! If it does please up-vote and select this answer, it'd be greatly appreciated!
-Dylan