Good evening!
I'm looking for some help to understand non-fatal behavior that I've been unable to correct. I've searched the official documentation, Google, StackExchange, etc, but so far I've come up empty handed (maybe I'm just not using the right search terms).
My setup is as follows:
1) SimpleSAMLphp 1.14 running on cluster nodes that sit behind an SSL-terminated balancer, running on Ubuntu 16 machines with PHP 5.6.28.
2) Integration with Memcache seems to be successful, and auth handshake between a local SP and a remote IDP (
testshib.org) works as expected, i.e. test users can login successfully and get redirected back to the SP landing page, where I can see their attributes.
3) The SSL-terminated nature of my balancer implies that the nodes talk in plain HTTP to it, even though balancer-outbound traffic is always HTTPS. The balancer replies with a 301 "Moved Permanently" response, with the corresponding HTTPS URL as "Location", for every HTTP request that it receives.
4) With this in context, I still managed to force HTTPS ACS URL's in the generated metadata for my test SP by setting a special value for the 'baseurlpath' config setting, i.e. "https://{$_SERVER['SERVER_NAME']}/simplesaml/"
With all of this in mind, auth handshake between the SP and IDP works fine, with one small non-fatal caveat. Once the IDP redirects back to the 'simplesaml/module.php/saml/sp/saml2-acs.php/usf' HTTPS SP URL (with 'usf' being my SP ID), if I'm not mistaken through the HTTP POST binding, the latter then issues the final redirect to the SP's landing page always over HTTP, as opposed to HTTPS.
The caveat is non-fatal because my balancer then takes care of that with a 301 redirect to the HTTPS URL, but I would still like to understand why this is happening. From all I've read so far, this final redirect URL should be HTTPS, since all the ACS URL's in the generated SP metadata are HTTPS. In fact, if I deploy this test SP to a machine that is not fronted by any balancer, and talks directly to the IDP over HTTPS (after generating the exact same SP metadata as in the other deployment), the redirect from the SP HTTP POST binding URL to the landing page does take place straight over HTTPS.
So, all in all, I haven't managed to understand this behavior so far, why the SP HTTP POST binding URL redirects to my landing page over HTTP when using the SSL-terminated balancer. My only hunch is the fact that SimpleSAMLphp is talking to the balancer over plain HTTP, and this protocol is what (perhaps erroneously?) gets used to construct the final redirect URL, but if so I have no idea how to correct it.
Any ideas? Thanks in advance!