Use secure cookies when the server is using SSL.

This registers a new middleware setting connection.proxySecure to the
appropriate value.