Added require https middleware activated by a config switch.