[#7787] get rid of weird problems where error handling and ssl redirects collide
[#7787] move "outer" middleware to be fully outside everything
[#7787] ticket:689 Handle unicode in ldap usernames and passwords